pip 安装频道:"python setup.py egg_info" 失败,错误代码为 1

pip install channels:"python setup.py egg_info" failed with error code 1

(some_virtual_env) # pip 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/

我尝试按照以下所述升级设置工具: 没用。

尝试过:

(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/

不确定还要检查和安装什么。

运行 下面命令先

sudo pip install pathlib

然后

pip install channels