【问题标题】:exit status 1 when trying to pip install cantools尝试 pip install cantools 时退出状态 1
【发布时间】:2020-08-31 13:05:15
【问题描述】:

每当我尝试 pip install 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 时发生的

【问题讨论】:

  • 可以用 Python3 代替吗?这确实是当今更好的选择,尤其是在 Python2 已经 EOL 之后。我刚刚测试,“cantools”的 34 和 35 版本都在 Py3.7 和 Py3.8 下成功安装。
  • 根据cantools docs:'Python 2 支持已被弃用,因为 Python 3 具有更好的 unicode 支持。'
  • @Gary02127 不幸的是,这是一些仍在使用 python 2 的遗留代码,这确实可以在另一台机器上运行,但我无法在我的机器上安装包
  • @MauriceMeyer 确实如此,但在 python2.7 上应该可以安装到版本 34.3.0 github.com/eerimoq/cantools/commits/master
  • 可以,但是diskcache的setup.py是为Python3写的。

标签: python python-2.7 pip can-bus


【解决方案1】:

我修好了,问题在于安装磁盘缓存模块, 默认情况下,它尝试安装支持 python 3 版本的版本 当我手动安装它时pip install diskcache==4.1.0 然后再次安装cantools就可以了。

【讨论】:

    猜你喜欢
    • 2020-12-09
    • 2020-02-24
    • 1970-01-01
    • 2020-08-14
    • 2021-03-31
    • 2021-07-12
    • 1970-01-01
    • 2016-02-21
    • 2018-09-21
    相关资源
    最近更新 更多