iT邦幫忙

0

#新手python 學習Neural Network遇到問題

安裝pip install os-win時
最後出現了以下錯誤

  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\sandr\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"'; __file__='"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sandr\AppData\Local\Temp\pip-wheel-jhplv897'
       cwd: C:\Users\sandr\AppData\Local\Temp\pip-install-n5pera4z\netifaces_770591b64df945149020b26d80733631\
  Complete output (5 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'netifaces' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for netifaces
  Running setup.py clean for netifaces
Failed to build netifaces
Installing collected packages: netifaces, netaddr, iso8601, debtcollector, stevedore, oslo.utils, oslo.serialization, oslo.context, oslo.config, fasteners, dnspython, wmi, PyMI, oslo.log, oslo.concurrency, eventlet, os-win
    Running setup.py install for netifaces ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\sandr\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"'; __file__='"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sandr\AppData\Local\Temp\pip-record-hzgramn4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sandr\anaconda3\Include\netifaces'
         cwd: C:\Users\sandr\AppData\Local\Temp\pip-install-n5pera4z\netifaces_770591b64df945149020b26d80733631\
    Complete output (5 lines):
    running install
    running build
    running build_ext
    building 'netifaces' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sandr\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"'; __file__='"'"'C:\\Users\\sandr\\AppData\\Local\\Temp\\pip-install-n5pera4z\\netifaces_770591b64df945149020b26d80733631\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sandr\AppData\Local\Temp\pip-record-hzgramn4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sandr\anaconda3\Include\netifaces' Check the logs for full command output.

請問是哪裡出問題呢@@

froce iT邦大師 1 級 ‧ 2021-05-26 08:47:51 檢舉
Microsoft Visual C++ 14.0 or greater is required.

很多python的大型套件都需要背後的C library,這是需要編譯的,但你沒編譯工具。(通常你有編譯工具也不容易編,在windows的無奈。)

解決法3選1:
1. 去下面網站看有沒有你要的套件
https://www.lfd.uci.edu/~gohlke/pythonlibs/

2.裝conda之類幫你弄好的套件管理

3.用linux當開發環境。

尚未有邦友回答

立即登入回答