尝试安装 matplotlib 时出错

问题描述 投票:0回答:1

我不是Python专家,这个项目曾经可以工作,但现在在尝试构建项目时给了我大量的红色错误:

pip2 install -r requirements.txt --no-cache-dir

有人可以帮我弄清楚如何解决它吗?据我所知,这个问题似乎与

matplotlib
numpy
有关。

我使用的是 macOS Sonoma 14.4.1 (23E224)。 python版本:Python 2.7.18 和 pip 版本:pip 20.3.4.

这是我的要求文件:

astropy == 2.0.16
atomicwrites == 1.4.0
attrs == 21.2.0
backports.functools-lru-cache == 1.6.4
bidict == 0.18.4
colorama == 0.4.4
cycler == 0.10.0
funcsigs == 1.0.2
kiwisolver == 1.1.0
matplotlib == 2.2.5
mock == 1.3.0
more-itertools == 5.0.0
nose == 1.3.7
numpy == 1.16.6
pandas == 0.24.2
pbr == 1.3.0
pluggy == 0.7.1
py == 1.11.0
pyparsing == 2.4.7
python-dateutil == 2.8.2
pytz == 2021.3
scipy == 1.2.3
six == 1.16.0
tk == 0.1.0
tqdm == 4.62.3
wheel == 0.24.0
lmfit == 0.9.15
ERROR: Command errored out with exit status 1:
     command: /Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-install-kadPSo/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-install-kadPSo/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-pip-egg-info-EdE3Nz
         cwd: /private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-install-kadPSo/matplotlib/
    Complete output (3002 lines):
    ============================================================================
    Edit setup.cfg to change the build options
    
    BUILDING MATPLOTLIB
                matplotlib: yes [2.2.5]
                    python: yes [2.7.18 (default, May 18 2024, 18:29:57)  [GCC
                            Apple LLVM 15.0.0 (clang-1500.3.9.4)]]
                  platform: yes [darwin]
    
    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [not found. pip may install it below.]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: yes [version 2.13.2]
                       png: yes [version 1.6.43]
                     qhull: yes [pkg-config information for 'libqhull' could not
                            be found. Using local copy.]
    
    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]
    
    OPTIONAL BACKEND EXTENSIONS
                    macosx: yes [installing, darwin]
                    qt5agg: no  [PySide2 not found; PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
      ERROR: Command errored out with exit status 1:
       command: /Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-wheel-3XAIjW/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-wheel-3XAIjW/numpy/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 /private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-wheel-lhR0EK
           cwd: /private/var/folders/t_/b3qw1kjj7sx5gxc_10fdxnbr0000gq/T/pip-wheel-3XAIjW/numpy/
      Complete output (2908 lines):
      Running from numpy source directory.
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      blis_info:
      customize UnixCCompiler
        libraries blis not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      openblas_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries tatlas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      atlas_3_10_blas_info:
      customize UnixCCompiler
        libraries satlas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      atlas_blas_info:
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      accelerate_info:
        FOUND:
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
          extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    
        FOUND:
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
          extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    
      /bin/sh: svnversion: command not found
      non-existing path in 'numpy/distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      openblas_lapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    
      openblas_clapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas,lapack not found in ['/Users/duaa.jaber/personalWorkSpace/asad/asad_dev_0.1.0/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
    

我无法发布整个错误正文,因为它有 3000 多行。

python macos matplotlib
1个回答
0
投票

我建议按步骤运行这些代码,看看是否可以解决问题。这个项目有多重要?

1-更新 pip 和 setuptools

pip install --upgrade pip setuptools

2-使用与您的Python兼容的numpy和matplotlib的兼容版本(您可能需要更新requirements.txt中的matplotlib版本):

matplotlib == 2.2.5

3-安装 numpy 和 matplotlib 的依赖项

pip install numpy==1.16.6
pip install matplotlib==2.2.5

4- 可能不是必需的但是修改您的构建环境,可以避免可能的编译问题:

pip install numpy==1.16.6 --no-build-isolation
pip install matplotlib==2.2.5 --no-build-isolation
© www.soinside.com 2019 - 2024. All rights reserved.