唯爱丶雪 发表于 2022-1-27 23:24:11

wxpython模块安装问题

Microsoft Windows [版本 10.0.22000.469]
(c) Microsoft Corporation。保留所有权利。

C:\Users\97055>pip install wxpython -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting wxpython
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b0/4d/80d65c37ee60a479d338d27a2895fb15bbba27a3e6bb5b6d72bb28246e99/wxPython-4.1.1.tar.gz (66.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\users\97055\appdata\local\programs\python\python310-32\lib\site-packages (from wxpython) (9.0.0)
Requirement already satisfied: six in c:\users\97055\appdata\local\programs\python\python310-32\lib\site-packages (from wxpython) (1.16.0)
Collecting numpy
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0a/c8/a62767a6b374a0dfb02d2a0456e5f56a372cdd1689dbc6ffb6bf1ddedbc0/numpy-1.22.1.zip (11.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Using legacy 'setup.py install' for wxpython, since package 'wheel' is not installed.
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
   command: 'C:\Users\97055\AppData\Local\Programs\Python\Python310-32\python.exe' 'C:\Users\97055\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Windows\TEMP\tmphh5o26x0'
       cwd: C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048
Complete output (70 lines):
Running from numpy source directory.
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Processing numpy/random\mtrand.pyx
Processing numpy/random\_bounded_integers.pyx.in
Processing numpy/random\_common.pyx
Processing numpy/random\_generator.pyx
Processing numpy/random\_mt19937.pyx
Processing numpy/random\_pcg64.pyx
Processing numpy/random\_philox.pyx
Processing numpy/random\_sfc64.pyx
Cythonizing sources
WARN: Could not locate executable g77
WARN: Could not locate executable f77
WARN: Could not locate executable ifort
WARN: Could not locate executable ifl
WARN: Could not locate executable f90
WARN: Could not locate executable DF
WARN: Could not locate executable efl
WARN: Could not locate executable gfortran
WARN: Could not locate executable f95
WARN: Could not locate executable g95
WARN: Could not locate executable efort
WARN: Could not locate executable efc
WARN: Could not locate executable flang
WARN: don't know how to compile Fortran code on platform 'nt'
C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048\numpy\distutils\system_info.py:2077: UserWarning:
      Optimized (vendor) Blas libraries are not found.
      Falls back to netlib Blas library which has worse performance.
      A better performance should be easily gained by switching
      Blas library.
    if self._calc_info(blas):
C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048\numpy\distutils\system_info.py:2077: UserWarning:
      Blas (http://www.netlib.org/blas/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section ) or by setting
      the BLAS environment variable.
    if self._calc_info(blas):
C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048\numpy\distutils\system_info.py:2077: UserWarning:
      Blas (http://www.netlib.org/blas/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section ) or by setting
      the BLAS_SRC environment variable.
    if self._calc_info(blas):
C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048\numpy\distutils\system_info.py:1902: UserWarning:
      Lapack (http://www.netlib.org/lapack/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section ) or by setting
      the LAPACK environment variable.
    return getattr(self, '_calc_info_{}'.format(name))()
C:\Windows\Temp\pip-install-nz5k8a0b\numpy_1d0c56a7a1a4467182971f381afdf048\numpy\distutils\system_info.py:1902: UserWarning:
      Lapack (http://www.netlib.org/lapack/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section ) or by setting
      the LAPACK_SRC environment variable.
    return getattr(self, '_calc_info_{}'.format(name))()
Warning: attempted relative import with no known parent package
C:\Windows\Temp\pip-build-env-4sk3uihz\overlay\Lib\site-packages\setuptools\_distutils\dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
non-existing path in 'numpy\\distutils': 'site.cfg'
running bdist_wheel
running build
running config_cc
running config_fc
running build_src
creating build
creating build\src.win32-3.10
creating build\src.win32-3.10\numpy
creating build\src.win32-3.10\numpy\distutils
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 numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

大佬们,我模块安装不上,大佬们帮忙分析下,我百度也搜了不行,谢谢!

胡鸣谦 发表于 2022-1-27 23:24:12

稳定版默认下载WHL包,成功概率大

isdkz 发表于 2022-1-27 23:51:08

本帖最后由 isdkz 于 2022-1-28 00:37 编辑

有一些扩展库用pip安装的时候再本地编译的,因为wxpython依赖numpy,
numpy是基于C语言写的扩展库,需要本地编译,你缺少vc编译工具所以numpy安装失败,
你可以根据报错提示去安装Microsoft Visual C++ 14.0 或 14.0以上的版本,
你也可以到https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy下载编译好的,
注意根据自己python的版本下载,下载到本地后在你的下载路径下打开cmd然后
pip install 你下载的whl文件名称(注意不要因为它的名字长就给它改了一个名字,改名字有可能会导致出错)

hrp 发表于 2022-1-28 00:40:39

先安装wheel包,再安装wxpython,试试

胡鸣谦 发表于 2022-1-29 08:49:45

python版本号,谢谢

胡鸣谦 发表于 2022-1-29 08:50:15

不要使用浏览版
老老实实用稳定版
页: [1]
查看完整版本: wxpython模块安装问题