安装gluonts[mxnet,pro]报错Building wheel for numpy (setup.py) ... error

pip install mxnet-1.7.0.post2-py2.py3-none-win_amd64.whl                                    
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple                                                            
Processing e:\google download\mxnet-1.7.0.post2-py2.py3-none-win_amd64.whl                                              
Collecting numpy<1.17.0,>=1.8.2 (from mxnet==1.7.0.post2)                                                               
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b7/6f/24647f014eef9b67a24adfcbcd4f4928349b4a0f8393b3d7fe648d4d2de3/numpy-1.16.6.zip (5.1 MB)                                                                                          
  Preparing metadata (setup.py) ... done                                                                                
Collecting requests<2.19.0,>=2.18.4 (from mxnet==1.7.0.post2)                                                           
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl (88 kB)                                                                       
Collecting graphviz<0.9.0,>=0.8.1 (from mxnet==1.7.0.post2)                                                             
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/53/39/4ab213673844e0c004bed8a0781a0721a3f6bb23eb8854ee75c236428892/graphviz-0.8.4-py2.py3-none-any.whl (16 kB)                                                                        
Collecting certifi>=2017.4.17 (from requests<2.19.0,>=2.18.4->mxnet==1.7.0.post2)                                       
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/12/90/3c9ff0512038035f59d279fddeb79f5f1eccd8859f06d6163c58798b9487/certifi-2024.8.30-py3-none-any.whl (167 kB)                                                                        
Collecting chardet<3.1.0,>=3.0.2 (from requests<2.19.0,>=2.18.4->mxnet==1.7.0.post2)                                    
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133 kB)                                                                        
Collecting idna<2.7,>=2.5 (from requests<2.19.0,>=2.18.4->mxnet==1.7.0.post2)                                           
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl (56 kB)                                                                              
Collecting urllib3<1.23,>=1.21.1 (from requests<2.19.0,>=2.18.4->mxnet==1.7.0.post2)                                    
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl (132 kB)                                                                         
Building wheels for collected packages: numpy                                                                           
  Building wheel for numpy (setup.py) ... error                                                                         
  error: subprocess-exited-with-error                                                                                   
                                                                                                                        
  × python setup.py bdist_wheel did not run successfully.                                                               
  │ exit code: 1                                                                                                        
  ╰─> [17 lines of output]                                                                                              
      Running from numpy source directory.                                                                              
      C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\numpy\distutils\misc_util.py:476: SyntaxWarning: "is" with a literal. Did you mean "=="?                                                   
        return is_string(s) and ('*' in s or '?' is s)                                                                  
      Traceback (most recent call last):                                                                                
        File "<string>", line 2, in <module>                                                                            
        File "<pip-setuptools-caller>", line 34, in <module>                                                            
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\setup.py", line 419, in <module>                                                                                                   
          setup_package()                                                                                               
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\setup.py", line 398, in setup_package                                                                                              
          from numpy.distutils.core import setup                                                                        
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\numpy\distutils\core.py", line 26, in <module>                                                                                     
          from numpy.distutils.command import config, config_compiler, \                                                
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\numpy\distutils\command\config.py", line 19, in <module>                                                                           
          from numpy.distutils.mingw32ccompiler import generate_manifest                                                
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-qcjapfxp\numpy_37c59c59c7c2402b9f5b9cf93d8cfe13\numpy\distutils\mingw32ccompiler.py", line 34, in <module>                                                                         
          from distutils.msvccompiler import get_build_version as get_build_msvc_version                                
      ModuleNotFoundError: No module named 'distutils.msvccompiler'                                                     
      [end of output]                                                                                                   
                                                                                                                        
  note: This error originates from a subprocess, and is likely not a problem with pip.                                  
  ERROR: Failed building wheel for numpy                                                                                
  Running setup.py clean for numpy                                                                                      
  error: subprocess-exited-with-error                                                                                   
                                                                                                                        
  × python setup.py clean did not run successfully.                                                                     
  │ exit code: 1                                                                                                        
  ╰─> [10 lines of output]                                                                                              
      Running from numpy source directory.                                                                              
                                                                                                                        
      `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).                                         
                                                                                                                        
      [end of output]                                                                                                   
                                                                                                                        
  note: This error originates from a subprocess, and is likely not a problem with pip.                                  
  ERROR: Failed cleaning build dir for numpy                                                                            
Failed to build numpy                                                                                                   
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (numpy)   

是因为依赖的包的版本问题,具体如下:

我的环境是python3.8

而该mxnet需要numpy版本

  • 大于或等于1.8.2
  • 小于1.17.0

在网址numpy · PyPI查询如下:

看到numpy<1.17.0时只用python3.7及以下的版本,将环境的python版本改为python=3.7即可安装。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值