pip install channels:" python setup.py egg_info"失败,错误代码为1

时间:2018-02-16 05:50:27

标签: python pip install django-channels

  

(some_virtual_env)#ppip install channels

给了我:

Collecting channels
  Using cached channels-2.0.2-py2.py3-none-any.whl
Collecting Django>=1.11 (from channels)
  Using cached Django-1.11.10-py2.py3-none-any.whl
Collecting asgiref~=2.1 (from channels)
  Using cached asgiref-2.1.5-py2.py3-none-any.whl
Collecting daphne~=2.0 (from channels)
  Using cached daphne-2.0.3-py2.py3-none-any.whl
Requirement already satisfied: pytz in /root/.virtualenvs/codebench/lib/python2.7/site-packages (from Django>=1.11->channels)
Collecting async-timeout~=2.0 (from asgiref~=2.1->channels)
  Using cached async-timeout-2.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-iii9a6/async-timeout/setup.py", line 1, in <module>
        import pathlib
    ImportError: No module named pathlib

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-iii9a6/async-timeout/

我尝试升级setuptools,如下所述:https://stackoverflow.com/a/36025294/646732 它没有用。

试过:

(test_python3) # apt-get install python3
(test_python3) # alias python=python3
(test_python3) # pip install async-timeout
(test_python3) # python -V
Python 3.5.2
(test_python3) # pip install async-timeout

它给了我:

Collecting async-timeout
  Using cached async-timeout-2.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-Dw6FjJ/async-timeout/setup.py", line 1, in <module>
        import pathlib
    ImportError: No module named pathlib

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Dw6FjJ/async-timeout/

不确定要检查和安装的其他内容。

1 个答案:

答案 0 :(得分:2)

首先运行以下命令

sudo pip install pathlib

然后

pip install channels
相关问题