安装python库时出现Visual C++ 14.0缺失异常

参考链接:

https://blog.csdn.net/qzzzxiaosheng/article/details/125119006

安装spyder 3.3.0版本时,出现以下问题,之前也出现过,不知道是什么原因。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5/wcwidth-0.2.5-py2.py3-none-any.whl
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
Complete output from command D:\ProgrammingTools\miniconda\envs\DLICA\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\23820\\AppData\\Local\\Temp\\pip-build-ipvupaoq\\psutil\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\23820\AppData\Local\Temp\tmpxqkvaonnpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\psutil
copying psutil\_common.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_compat.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psaix.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psbsd.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pslinux.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psosx.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psposix.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pssunos.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pswindows.py -> build\lib.win-amd64-3.6\psutil
copying psutil\__init__.py -> build\lib.win-amd64-3.6\psutil
creating build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\runner.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_aix.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_bsd.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_connections.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_contracts.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_linux.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_memleaks.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_misc.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_osx.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_posix.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_process.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_sunos.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_system.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_testutils.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_unicode.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_windows.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\__init__.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\__main__.py -> build\lib.win-amd64-3.6\psutil\tests
running build_ext
building 'psutil._psutil_windows' 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

----------------------------------------
Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: wrapt, lazy-object-proxy, typing-extensions, typed-ast, astroid, isort, platformdirs, colorama, mccabe, toml, pylint, parso, jedi, ipython-genutils, six, decorator, traitlets, pickleshare, wcwidth, prompt-toolkit, pygments, backcall, ipython, tornado, pyzmq, python-dateutil, entrypoints, pywin32, jupyter-core, nest-asyncio, jupyter-client, ipykernel, pyparsing, packaging, qtpy, qtconsole, pyflakes, psutil, cloudpickle, spyder-kernels, qtawesome, zipp, importlib-metadata, pywin32-ctypes, keyring, rope, pyrsistent, attrs, jsonschema, nbformat, testpath, defusedxml, pandocfilters, async-generator, nbclient, webencodings, bleach, jupyterlab-pygments, mistune, MarkupSafe, jinja2, nbconvert, sphinxcontrib-serializinghtml, sphinxcontrib-applehelp, sphinxcontrib-devhelp, pytz, babel, docutils, alabaster, sphinxcontrib-htmlhelp, sphinxcontrib-jsmath, charset-normalizer, idna, urllib3, requests, imagesize, snowballstemmer, sphinxcontrib-qthelp, sphinx, chardet, sip, pyqt5, numpydoc, pycodestyle, spyder
Running setup.py install for psutil ... error
Complete output from command D:\ProgrammingTools\miniconda\envs\DLICA\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\23820\\AppData\\Local\\Temp\\pip-build-ipvupaoq\\psutil\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\23820\AppData\Local\Temp\pip-6y9xal0p-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\psutil
copying psutil\_common.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_compat.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psaix.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psbsd.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pslinux.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psosx.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psposix.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pssunos.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pswindows.py -> build\lib.win-amd64-3.6\psutil
copying psutil\__init__.py -> build\lib.win-amd64-3.6\psutil
creating build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\runner.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_aix.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_bsd.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_connections.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_contracts.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_linux.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_memleaks.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_misc.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_osx.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_posix.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_process.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_sunos.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_system.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_testutils.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_unicode.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_windows.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\__init__.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\__main__.py -> build\lib.win-amd64-3.6\psutil\tests
running build_ext
building 'psutil._psutil_windows' 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

----------------------------------------
Command "D:\ProgrammingTools\miniconda\envs\DLICA\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\23820\\AppData\\Local\\Temp\\pip-build-ipvupaoq\\psutil\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\23820\AppData\Local\Temp\pip-6y9xal0p-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\23820\AppData\Local\Temp\pip-build-ipvupaoq\psutil\
You are using pip version 9.0.1, however version 22.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

2.解决方案

安装下述包即可。

1
conda install libpython m2w64-toolchain -c msys2

安装python库时出现Visual C++ 14.0缺失异常
https://fulequn.github.io/2022/11/Article202211111/
作者
Fulequn
发布于
2022年11月11日
许可协议