6

pip安装库时报错Microsoft Visual C++ 14.0 is required?

 1 year ago
source link: https://xugaoxiang.com/2023/05/14/pip-install-microsoft-visual-c-14-0-is-required/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

多次碰到网友朋友的咨询,问题是在使用 pip 安装某个库时报错,信息是

running install
running build
running build_py
...
building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
  1. 按照错误提示安装 Visual C++,到微软官网 https://visualstudio.microsoft.com

    Microsoft Visual C++ 14.0 is required
  2. 下载完成开始安装

Microsoft Visual C++ 14.0 is required
  1. 在安装组件时,选择 Desktop development with C++
Microsoft Visual C++ 14.0 is required

安装完成后,需要重启电脑

  1. 如果问题还存在的话,可以去升级下 setuptools 模块
pip install -U setuptools

如果是碰到 pip 无法使用,可以到站点 https://bootstrap.pypa.io/get-pip.py 下载文件保存起来,比如 getpip.py,然后进入到自己的 python 环境,执行

python getpip.py

这个脚本会去安装或者升级 pip,同时也会安装 setuptoolswheel 这2个模块,如果环境中它们也缺失的话。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK