A-A+

uilding ‘psutil._psutil_windows’ extension error: Microsoft Visual C++ 14.0 is required

2020年04月17日 14:16 学习笔记 暂无评论 阅读 78 views 次

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

报错信息:

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
Collecting psutil==5.6.3
  Using cached psutil-5.6.3.tar.gz (435 kB)
Installing collected packages: psutil
  Attempting uninstall: psutil
    Found existing installation: psutil 5.7.0
    Uninstalling psutil-5.7.0:
      Successfully uninstalled psutil-5.7.0
    Running setup.py install for psutil: started
    Running setup.py install for psutil: finished with status 'error'
  Rolling back uninstall of psutil
  Moving to d:\python\python37-32\lib\site-packages\psutil-5.7.0.dist-info\
   from D:\python\Python37-32\Lib\site-packages\~sutil-5.7.0.dist-info
  Moving to d:\python\python37-32\lib\site-packages\psutil\
   from D:\python\Python37-32\Lib\site-packages\~sutil
 
    ERROR: Command errored out with exit status 1:
     command: 'D:\python\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ycx8714\\AppData\\Local\\Temp\\pycharm-packaging\\psutil\\setup.py'"'"'; __file__='"'"'C:\\Users\\ycx8714\\AppData\\Local\\Temp\\pycharm-packaging\\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\ycx8714\AppData\Local\Temp\pip-record-gl12lj9w\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\python\Python37-32\Include\psutil'
         cwd: C:\Users\ycx8714\AppData\Local\Temp\pycharm-packaging\psutil\
    Complete output (39 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\psutil
    copying psutil\_common.py -> build\lib.win32-3.8\psutil
    copying psutil\_compat.py -> build\lib.win32-3.8\psutil
    copying psutil\_psaix.py -> build\lib.win32-3.8\psutil
    copying psutil\_psbsd.py -> build\lib.win32-3.8\psutil
    copying psutil\_pslinux.py -> build\lib.win32-3.8\psutil
    copying psutil\_psosx.py -> build\lib.win32-3.8\psutil
    copying psutil\_psposix.py -> build\lib.win32-3.8\psutil
    copying psutil\_pssunos.py -> build\lib.win32-3.8\psutil
    copying psutil\_pswindows.py -> build\lib.win32-3.8\psutil
    copying psutil\__init__.py -> build\lib.win32-3.8\psutil
    creating build\lib.win32-3.8\psutil\tests
    copying psutil\tests\runner.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_aix.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_bsd.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_connections.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_contracts.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_linux.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_memory_leaks.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_misc.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_osx.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_posix.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_process.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_sunos.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_system.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_unicode.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\test_windows.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\__init__.py -> build\lib.win32-3.8\psutil\tests
    copying psutil\tests\__main__.py -> build\lib.win32-3.8\psutil\tests
    warning: build_py: byte-compiling is disabled, skipping.
 
    running build_ext
    building 'psutil._psutil_windows' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\python\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ycx8714\\AppData\\Local\\Temp\\pycharm-packaging\\psutil\\setup.py'"'"'; __file__='"'"'C:\\Users\\ycx8714\\AppData\\Local\\Temp\\pycharm-packaging\\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\ycx8714\AppData\Local\Temp\pip-record-gl12lj9w\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\python\Python37-32\Include\psutil' Check the logs for full command output.

解决办法
解决方案并不需要重装VS

http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted进入网页,下载对应版本的whl文件:

Twisted‑17.9.0‑cp36‑cp36m‑win_amd64.whl

Tips:cp36代表我的python3.6版本,amd64代表我的python3.6版本安装的是64位的。

pip install C:\Users\CR\Downloads\Twisted‑17.9.0‑cp36‑cp36m‑win_amd64.whl

pip install Scrapy​

布施恩德可便相知重

微信扫一扫打赏

支付宝扫一扫打赏

×

给我留言