首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:为[Python包]构建轮子失败|轮子问题(有时)

错误:为[Python包]构建轮子失败|轮子问题(有时)
EN

Stack Overflow用户
提问于 2020-11-08 01:06:22
回答 2查看 6.3K关注 0票数 1

每当我安装一个需要轮子的python包时,我都会得到这样的错误:

代码语言:javascript
复制
$ pip install PyWavelets
Collecting PyWavelets
  Downloading PyWavelets-1.1.1.tar.gz (4.6 MB)
     |████████████████████████████████| 4.6 MB 344 kB/s
Requirement already satisfied: numpy>=1.13.3 in c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages (from PyWav
elets) (1.19.4)
Building wheels for collected packages: PyWavelets
  Building wheel for PyWavelets (setup.py) ... - ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0]
 = '"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\Ap
pData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\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\MYUSERNAME\Ap
pData\Local\Temp\pip-wheel-ns2hq1xm'
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\
  Complete output (15 lines):
  C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py:62: DeprecationWarning: the imp module is deprecated i
n favour of importlib; see the module's documentation for alternative uses
    import imp
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 477, in <module>
      setup_package()
    File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 467, in setup_package
      ext_modules = get_ext_modules(USE_CYTHON)
    File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 182, in get_ext_modules
      from numpy import get_include as get_numpy_include
    File "c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
      _win_os_check()
    File "c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
      raise RuntimeError(msg.format(__file__)) from None
  RuntimeError: The current Numpy installation ('c:\\users\\MYUSERNAME\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\
numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https:/
/STACKOVERFLOW DOESN'T LIKE TINYURL
  ----------------------------------------
  ERROR: Failed building wheel for PyWavelets
  Running setup.py clean for PyWavelets
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0]
 = '"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\Ap
pData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets
  Complete output (11 lines):
  C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py:62: DeprecationWarning: the imp module is deprecated i
n favour of importlib; see the module's documentation for alternative uses
    import imp

  `setup.py clean` is not supported, use one of the following instead:

    - `git clean -xdf` (cleans all files)
    - `git clean -Xdf` (cleans all versioned files, doesn't touch
                        files that aren't checked into the git repo)

  Add `--force` to your command to use it anyway if you must (unsupported).

  ----------------------------------------
  ERROR: Failed cleaning build dir for PyWavelets
Failed to build PyWavelets
Installing collected packages: PyWavelets
    Running setup.py install for PyWavelets ... - ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[
0] = '"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"'; __file__='"'"'C:\\Users\\MYUSERNAME\\
AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.re
ad().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\erik
u\AppData\Local\Temp\pip-record-apt8ex91\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\us
ers\MYUSERNAME\appdata\local\programs\python\python39\Include\PyWavelets'
         cwd: C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\
    Complete output (24 lines):
    C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py:62: DeprecationWarning: the imp module is deprecated
 in favour of importlib; see the module's documentation for alternative uses
      import imp

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install PyWavelets`   (last PyWavelets release on PyPI)


    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 477, in <module>
        setup_package()
      File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 467, in setup_package
        ext_modules = get_ext_modules(USE_CYTHON)
      File "C:\Users\MYUSERNAME\AppData\Local\Temp\pip-install-8tqnlgrn\pywavelets\setup.py", line 182, in get_ext_modules
        from numpy import get_include as get_numpy_include
      File "c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
        _win_os_check()
      File "c:\users\MYUSERNAME\appdata\local\programs\python\python39\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
        raise RuntimeError(msg.format(__file__)) from None
    RuntimeError: The current Numpy installation ('c:\\users\\MYUSERNAME\\appdata\\local\\programs\\python\\python39\\lib\\site-packages
\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https
:STACKOVERFLOW DOESN'T LIKE TINYURL
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\python.exe' -u -c 'import sys
, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"';
 __file__='"'"'C:\\Users\\MYUSERNAME\\AppData\\Local\\Temp\\pip-install-8tqnlgrn\\pywavelets\\setup.py'"'"';f=getattr(tokenize, '"'"'ope
n'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))
' install --record 'C:\Users\MYUSERNAME\AppData\Local\Temp\pip-record-apt8ex91\install-record.txt' --single-version-externally-managed -
-compile --install-headers 'c:\users\MYUSERNAME\appdata\local\programs\python\python39\Include\PyWavelets' Check the logs for full comma
nd output.

我不知道这是车轮的问题还是pip的问题!

以下是我的系统规格:

代码语言:javascript
复制
Host Name:                 DESKTOP
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19041 N/A Build 19041
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          (not leaking my E-Mail here, folks)
Registered Organization:   N/A
Product ID:                (not leaking this either)
Original Install Date:     15/08/2020, 22:55:17
System Boot Time:          07/11/2020, 09:52:30
System Manufacturer:       Micro-Star International Co., Ltd.
System Model:              MS-7B09
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 23 Model 1 Stepping 1 AuthenticAMD ~3500 Mhz
BIOS Version:              American Megatrends Inc. A.70, 14/11/2018
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume6
System Locale:             en-us;English (United States)
Input Locale:              (take a wild guess)
Time Zone:                 (Im always awake)
Total Physical Memory:     65.428 MB
Available Physical Memory: 52.078 MB
Virtual Memory: Max Size:  75.156 MB
Virtual Memory: Available: 52.887 MB
Virtual Memory: In Use:    22.269 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\DESKTOP

如您所见,我正在使用BASH for Windows!任何事都能帮上忙!

(同样,PyWavelets在这里只是一个例子!这在很多包中都会发生)

我不知道为什么会发生这种情况,我今天才重新安装了python等等。这台机器上的大多数东西都很新鲜和清晰。如果你能从这些错误中读到任何东西,我将非常感谢你能把它贴在这里。

EN

回答 2

Stack Overflow用户

发布于 2020-11-08 01:13:45

如错误消息中所示,windows中存在导致此问题的错误。

临时解决方案是使用numpy 1.19.3。你有1.19.4。

代码语言:javascript
复制
pip uninstall numpy
pip install numpy==1.19.3

然后再次运行安装脚本。

来自this的微软线程修复将在2021年1月左右推出。

票数 0
EN

Stack Overflow用户

发布于 2020-11-08 01:45:46

这是因为我使用的是Python3.9,它是相当新的,这就是为什么我使用的包(包括轮子)都不能工作。这是一个python错误。

安装python 3.8 (并将其添加到路径)修复了该问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64730294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档