【问题标题】:When running pip install channels I get the following this error运行 pip install channels 时出现以下错误
【发布时间】:2021-05-09 08:38:17
【问题描述】:

运行pip install channels 时出现以下错误。 ImportError: 没有名为 pathlib 的模块。

ERROR: Command errored out with exit status 1:
         command: 'E:\Users\S.Mary\Documents\WebProject1\chatty_env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\s3c67~1.mar\\appdata\\local\\temp\\pip-install-spnlrp\\async-timeout\\setup.py'"'"'; __file__='"'"'c:\\users\\s3c67~1.mar\\appdata\\local\\temp\\pip-install-spnlrp\\async-timeout\\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\s3c67~1.mar\appdata\local\temp\pip-pip-egg-info-yzixua'
             cwd: c:\users\s3c67~1.mar\appdata\local\temp\pip-install-spnlrp\async-timeout\
        Complete output (5 lines):
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "c:\users\s3c67~1.mar\appdata\local\temp\pip-install-spnlrp\async-timeout\setup.py", line 1, in <module>
            import pathlib
        ImportError: No module named pathlib
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

【问题讨论】:

    标签: python django pip django-channels


    【解决方案1】:

    在命令行上运行:

    pip install pathlib
    

    或在 Linux 上

    sudo pip install pathlib
    

    【讨论】:

    • @Mary Нет проблем!
    • 但是在运行 pip install channels_redis 时出现以下相同的错误
    • 是不是说No module named pathlib有误?
    • "RuntimeError: aioredis 不支持 Python 3.5 之前的版本"
    • @Mary 看来您现在遇到了不同的问题
    【解决方案2】:

    python 抱怨它找不到名为 pathlib 的模块。您可以根据您的 python 版本使用 pip 或 pip3 添加到您的库中。

    甚至 pathlib2 并相应地更改您的代码。 https://pypi.org/project/pathlib/

    回溯(最近一次调用最后一次):文件“”,第 1 行,在文件“c:\users\s3c67~1.mar\appdata\local\temp\pip-install-spnlrp\async-timeout\setup. py",第 1 行,在 import pathlib ImportError: No module named pathlib ---------------------------- ------------ ERROR: Command errored out with exit status 1: python setup.py egg_info 检查日志以获取完整的命令输出。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-04
      • 1970-01-01
      • 1970-01-01
      • 2023-02-04
      相关资源
      最近更新 更多