尝试pip安装cantools时退出状态1

2024-10-02 06:24:20 发布

您现在位置:Python中文网/ 问答频道 /正文

每当我尝试pip安装cantools==34.0.0时(在python 2.7上) 我收到错误消息:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support
in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting cantools==34.0.0
  Using cached cantools-34.0.0-py2.py3-none-any.whl (77 kB)
Collecting diskcache
  Using cached diskcache-5.0.2.tar.gz (47 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\bla\\appdata\\local\\temp\\pip-install-4or8zd\\diskcache\\setup.py'"'"'; __file__='"'"'c:\\
users\\bla\\appdata\\local\\temp\\pip-install-4or8zd\\diskcache\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"
'"'))' egg_info --egg-base 'c:\users\bla\appdata\local\temp\pip-pip-egg-info-mxhtc0'
         cwd: c:\users\bla\appdata\local\temp\pip-install-4or8zd\diskcache\
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\bla\appdata\local\temp\pip-install-4or8zd\diskcache\setup.py", line 5, in <module>
        import diskcache
      File "diskcache\__init__.py", line 9, in <module>
        from .core import (
      File "diskcache\core.py", line 434
        raise ValueError('disk must subclass diskcache.Disk') from None
                                                                 ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

有人能帮我吗?它似乎是在尝试安装diskcache包时发生的


Tags: installpipinpyegglocalsetupline
1条回答
网友
1楼 · 发布于 2024-10-02 06:24:20

我修复了,问题是安装diskcache模块, 默认情况下,它尝试安装python 3版本支持的版本 当我手动安装它时pip install diskcache==4.1.0 然后安装了cantools,它又开始工作了

相关问题 更多 >

    热门问题