简体   繁体   English

“注意:此错误源自子进程,并且可能不是 pip 的问题”消息在尝试安装 spacepy 时

[英]"note: This error originates from a subprocess, and is likely not a problem with pip" message when trying to install spacepy

I'm trying to install the spacepy package on Pycharm (Mac), but the installation keeps failing and I get this:我正在尝试在 Pycharm(Mac)上安装 spacepy package,但安装一直失败,我得到了这个:

Collecting spacepy
  Using cached spacepy-0.3.0.zip (19.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting h5py>=2.6
  Using cached h5py-3.7.0-cp310-cp310-macosx_10_9_x86_64.whl (3.2 MB)
Requirement already satisfied: scipy>=0.11 in ./venv/lib/python3.10/site-packages (from spacepy) (1.8.1)
Requirement already satisfied: numpy!=1.15.0,>=1.10 in ./venv/lib/python3.10/site-packages (from spacepy) (1.22.4)
Requirement already satisfied: python-dateutil>=1.4 in ./venv/lib/python3.10/site-packages (from spacepy) (2.8.2)
Requirement already satisfied: matplotlib>=1.5 in ./venv/lib/python3.10/site-packages (from spacepy) (3.5.2)
Requirement already satisfied: pillow>=6.2.0 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (9.1.1)
Requirement already satisfied: fonttools>=4.22.0 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (4.33.3)
Requirement already satisfied: packaging>=20.0 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (21.3)
Requirement already satisfied: pyparsing>=2.2.1 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (3.0.9)
Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./venv/lib/python3.10/site-packages (from matplotlib>=1.5->spacepy) (1.4.2)
Requirement already satisfied: six>=1.5 in ./venv/lib/python3.10/site-packages (from python-dateutil>=1.4->spacepy) (1.16.0)
Building wheels for collected packages: spacepy
  Building wheel for spacepy (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for spacepy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [188 lines of output]
      running bdist_wheel
      running build
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
      
      creating build
      creating build/temp.macosx-10.9-universal2-3.10
      creating build/temp.macosx-10.9-universal2-3.10/spacepy
      creating build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy
      INFO: compile options: '-c'
      INFO: clang: spacepy/libspacepy/toolbox.c
      INFO: clang: spacepy/libspacepy/randomkit.c
      INFO: clang: spacepy/libspacepy/cn_solver.c
      INFO: clang: spacepy/libspacepy/ctrace2d.c
      INFO: clang: spacepy/libspacepy/poppy.c
      creating build/lib
      creating build/lib/spacepy
      INFO: clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy/toolbox.o build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy/randomkit.o build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy/cn_solver.o build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy/ctrace2d.o build/temp.macosx-10.9-universal2-3.10/spacepy/libspacepy/poppy.o -lm -o build/lib/spacepy/libspacepy.so
      running config_fc
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running config_cc
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running build_py
      copying spacepy/omni.py -> build/lib/spacepy
      copying spacepy/radbelt.py -> build/lib/spacepy
      copying spacepy/LANLstar.py -> build/lib/spacepy
      copying spacepy/seapy.py -> build/lib/spacepy
      copying spacepy/time.py -> build/lib/spacepy
      copying spacepy/lib.py -> build/lib/spacepy
      copying spacepy/datamodel.py -> build/lib/spacepy
      copying spacepy/__init__.py -> build/lib/spacepy
      copying spacepy/empiricals.py -> build/lib/spacepy
      copying spacepy/igrf.py -> build/lib/spacepy
      copying spacepy/datamanager.py -> build/lib/spacepy
      copying spacepy/rst.py -> build/lib/spacepy
      copying spacepy/data_assimilation.py -> build/lib/spacepy
      copying spacepy/poppy.py -> build/lib/spacepy
      copying spacepy/spacepy_EnKF.py -> build/lib/spacepy
      copying spacepy/coordinates.py -> build/lib/spacepy
      copying spacepy/ae9ap9.py -> build/lib/spacepy
      creating build/lib/spacepy/irbempy
      copying spacepy/irbempy/__init__.py -> build/lib/spacepy/irbempy
      copying spacepy/irbempy/irbempy.py -> build/lib/spacepy/irbempy
      creating build/lib/spacepy/pycdf
      copying spacepy/pycdf/__init__.py -> build/lib/spacepy/pycdf
      copying spacepy/pycdf/istp.py -> build/lib/spacepy/pycdf
      copying spacepy/pycdf/const.py -> build/lib/spacepy/pycdf
      creating build/lib/spacepy/plot
      copying spacepy/plot/__init__.py -> build/lib/spacepy/plot
      copying spacepy/plot/carrington.py -> build/lib/spacepy/plot
      copying spacepy/plot/apionly.py -> build/lib/spacepy/plot
      copying spacepy/plot/utils.py -> build/lib/spacepy/plot
      copying spacepy/plot/spectrogram.py -> build/lib/spacepy/plot
      creating build/lib/spacepy/pybats
      copying spacepy/pybats/batsmath.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/rim.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/trace2d.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/__init__.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/bats.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/gitm.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/pwom.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/kyoto.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/dipole.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/interact.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/ram.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/dgcpm.py -> build/lib/spacepy/pybats
      copying spacepy/pybats/qotree.py -> build/lib/spacepy/pybats
      creating build/lib/spacepy/toolbox
      copying spacepy/toolbox/__init__.py -> build/lib/spacepy/toolbox
      creating build/lib/spacepy/ctrans
      copying spacepy/ctrans/__init__.py -> build/lib/spacepy/ctrans
      copying spacepy/ctrans/iau80n.py -> build/lib/spacepy/ctrans
      creating build/lib/spacepy/data
      copying spacepy/data/spacepy_polar.mplstyle -> build/lib/spacepy/data
      copying spacepy/data/tai-utc.dat -> build/lib/spacepy/data
      copying spacepy/data/spacepy_altgrid.mplstyle -> build/lib/spacepy/data
      copying spacepy/data/igrf13coeffs.txt -> build/lib/spacepy/data
      copying spacepy/data/spacepy.mplstyle -> build/lib/spacepy/data
      copying spacepy/data/SEA_epochs_OMNI.txt -> build/lib/spacepy/data
      creating build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_OPDyn.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_T01STORM.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_T01STORM.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_T89.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_OPQuiet.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_OPQuiet.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_T05.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_T96.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_OPDyn.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_RAMSCB.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_T01QUIET.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_T05.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_T01QUIET.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/Lmax_T96.net.gz -> build/lib/spacepy/data/LANLstar
      copying spacepy/data/LANLstar/LANLstar_T89.net.gz -> build/lib/spacepy/data/LANLstar
      creating build/lib/spacepy/data/TS07D
      creating build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_31.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_44.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_51.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_24.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_32.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_53.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_52.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_33.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_23.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_42.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_43.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_22.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_34.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_41.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_54.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_21.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_52.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_33.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_32.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_53.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_51.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_24.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_31.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_44.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_54.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_21.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_34.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_41.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_43.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_22.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_23.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_42.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_12.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_13.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamebhr4.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_11.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamebhr5.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamebhr1.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_o_14.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamebhr2.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamebhr3.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_11.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_13.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_12.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      copying spacepy/data/TS07D/TAIL_PAR/tailamhr_e_14.par -> build/lib/spacepy/data/TS07D/TAIL_PAR
      INFO: customize Gnu95FCompiler
      WARN: Could not locate executable gfortran
      WARN: Could not locate executable f95
      Traceback (most recent call last):
        File "/Users/nquartey/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/nquartey/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/nquartey/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 221, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 207, in _build_with_temp_dir
          self.run_setup()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 258, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 150, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 950, in <module>
          setup(**setup_kwargs)
        File "/private/var/folders/62/c7kp5v4x5s39gykb57h2t7_m0000gs/T/pip-build-env-k4szbbs7/overlay/lib/python3.10/site-packages/numpy/distutils/core.py", line 169, in setup
          return old_setup(**new_attr)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/62/c7kp5v4x5s39gykb57h2t7_m0000gs/T/pip-build-env-k4szbbs7/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "setup.py", line 733, in run
          self.compile_irbempy()
        File "setup.py", line 507, in compile_irbempy
          f2py_env, fcompexec = f2py_options(fcompiler, self.distribution)
        File "setup.py", line 200, in f2py_options
          fcomp.customize(dist)
        File "/private/var/folders/62/c7kp5v4x5s39gykb57h2t7_m0000gs/T/pip-build-env-k4szbbs7/overlay/lib/python3.10/site-packages/numpy/distutils/fcompiler/__init__.py", line 457, in customize
          self.find_executables()
        File "/private/var/folders/62/c7kp5v4x5s39gykb57h2t7_m0000gs/T/pip-build-env-k4szbbs7/overlay/lib/python3.10/site-packages/numpy/distutils/fcompiler/__init__.py", line 346, in find_executables
          raise CompilerNotFound('%s: f90 nor f77' % ctype)
      numpy.distutils.fcompiler.CompilerNotFound: gnu95: f90 nor f77
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for spacepy
Failed to build spacepy
ERROR: Could not build wheels for spacepy, which is required to install pyproject.toml-based projects

What can I do to get past this issue?我能做些什么来解决这个问题? Here's what I've tried in the Python and Mac terminals, but I still receive the message above:这是我在 Python 和 Mac 终端中尝试过的,但我仍然收到上面的消息:

pip install spacepy
pip install --no-cache-dir spacepy 
pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade wheel
pip install spacepy --user
pip install --no-cache-dir spacepy

I'm a new Mac user, so if anything can be dumbed down for me that would be greatly appreciated.我是一个新的 Mac 用户,所以如果有什么可以为我简化的,我将不胜感激。 Also, please let me know if there's any information you may need me to include.另外,如果您需要我提供任何信息,请告诉我。

If you are using MacOS or Windows, try installing gfortran.如果您使用的是 MacOS 或 Windows,请尝试安装 gfortran。

(If you are using Linux, try installing gcc-fortran) (如果您使用的是 Linux,请尝试安装 gcc-fortran)

There is a possible workaround for this problem if you use conda.如果您使用 conda,则有可能解决此问题。 The idea is to create an X86 environment on the Mac and do your pip install after that.这个想法是在 Mac 上创建一个 X86 环境,然后安装 pip。

conda create -n <name>
conda activate <name>
conda config --env --set subdir osx-64
conda install python=3.8  

Here I choose python 3.8, but you can choose another version.这里我选择python 3.8,但你可以选择其他版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM