【持续更新】在虚拟环境下,解决模块无法下载成功的方法

场景:

以下就是遇到下载各个模块时,所遇到的不同的问题。

问题:

下载模块win32gui时出错
error: subprocess-exited-with-error
ModuleNotFoundError: No module named ‘win32.distutils.command’
note: This error originates from a subprocess, and is likely not a problem with pip.

解决方案:
由于本文使用的python3.7版本,它的win32gui集成到了pywin32中,所以只需下载pywin32,使用win32gui时不会报错。
只需下载pywin32即可
pip install pywin32 -i https://pypi.tuna.tsinghua.edu.cn/simple


下载comtypes出错
ERROR: Cannot determine archive format of C:\Users\用户名\AppData\Local\Temp\pip-req-build-bqigqnga

解决方案:
更换源下载时会出现该错误 只需在命令中加入 --trusted-host 源的名称 即可
如:pip install comtypes -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn


下载dlib出错
Building wheel for dlib (setup.py) … error

解决方案:
pip install cmake
pip install boost


pip install cmake出现错误:
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.

解决方法:
unset all_proxy


下载skimage出错:

ERROR: Could not find a version that satisfies the requirement skiamge (from versions: none)
ERROR: No matching distribution found for skiamge

解决方法: pip install scikit-image


下载tensoflow出错:

问题1:ERROR: pytest-astropy 0.8.0 requires pytest-cov>=2.0, which is not installed.

解决方法:pip install pytest-astropy

问题2:You are using pip version 20.3.4, however version 22.2.2 is available. You should consider upgrading via the ‘pip install --upgrade pip’ command.

解决方法:pip install --upgrade pip

问题3: protobuf requires Python ‘>=3.7’ but the running Python is 2.7.13

解决方法:(在官网上直接下载protobuf 3.6.1) cd protobuf-3.6.1进入到该目录下执行以下命令:(在root用户下)
./autogen.sh
./configure
make
make check
通过which protoc 查看protoc的位置它生成的protoc文件在系统文件目录下 我们的是:/usr/local/bin/protoc
如在conda环境下 则将该protoc文件移至(或复制) /mnt/usr/local/anaconda3/envs/TF1-py2.7/bin/ 目录下
protoc --version(若出现 libprotoc 3.6.1)则下载成功
【持续更新】在虚拟环境下,解决模块无法下载成功的方法_第1张图片


下载opencv出错:

ERROR: Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support.

解决方法: unset all_proxy

你可能感兴趣的:(bug合集,python,bug)