pip install SciPy创建安装错误

jhkqcmku  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(465)

Hi I am constantly having this error below. I am a novice using code and been facing this issue which I cannot resolve. Can someone help?
Collecting scipy (from -r requirements.txt (line 49)) Obtaining dependency information for scipy from https://files.pythonhosted.org/packages/06/15/e73734f9170b66c6a84a0bd7e03586e87e77404e2eb8e34749fc49fa43f7/scipy-1.11.2-cp311-cp311-win_amd64.whl.metadata Using cached scipy-1.11.2-cp311-cp311-win_amd64.whl.metadata (59 kB) Obtaining dependency information for scipy from https://files.pythonhosted.org/packages/04/b8/947f40706ee2e316fd1a191688f690c4c2b351c2d043fe9deb9b7940e36e/scipy-1.11.1-cp311-cp311-win_amd64.whl.metadata Using cached scipy-1.11.1-cp311-cp311-win_amd64.whl.metadata (59 kB) Using cached scipy-1.10.1-cp311-cp311-win_amd64.whl (42.2 MB) Using cached scipy-1.10.0-cp311-cp311-win_amd64.whl (42.2 MB) Using cached scipy-1.9.3-cp311-cp311-win_amd64.whl (39.9 MB) Using cached scipy-1.9.2-cp311-cp311-win_amd64.whl (39.9 MB) Using cached scipy-1.9.1.tar.gz (42.0 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [55 lines of output] The Meson build system Version: 0.62.2 Source dir: C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f Build dir: C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f.mesonpy-di88mzar\build Build type: native build Project name: SciPy Project version: 1.9.1 WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
  The following exception(s) were encountered:
  Running "icl " gave "[WinError 2] 지정된 파일을 찾을 수 없습니다"
  Running "cl /?" gave "[WinError 2] 지정된 파일을 찾을 수 없습니다"
  Running "cc --version" gave "[WinError 2] 지정된 파일을 찾을 수 없습니다"
  Running "gcc --version" gave "[WinError 2] 지정된 파일을 찾을 수 없습 니다"
  Running "clang --version" gave "[WinError 2] 지정된 파일을 찾을 수 없 습니다"
  Running "clang-cl /?" gave "[WinError 2] 지정된 파일을 찾을 수 없습니 다"
  Running "pgcc --version" gave "[WinError 2] 지정된 파일을 찾을 수 없습니다"

  A full log can be found at C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f\.mesonpy-di88mzar\build\meson-logs\meson-log.txt
  + meson setup --native-file=C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=C:\Users\corea\AppData\Local\Programs\Python\Python311 C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f C:\Users\corea\AppData\Local\Temp\pip-install-ecec4diw\scipy_3c6340d51124457a8297a77c748f217f\.mesonpy-di88mzar\build
  Traceback (most recent call last):
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 969, in get_requires_for_build_wheel
      with _project(config_settings) as project:
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
      return next(self.gen)
             ^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 948, in _project
      with Project.with_temp_working_dir(
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
      return next(self.gen)
             ^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 777, in with_temp_working_dir
      yield cls(source_dir, tmpdir, build_dir)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 682, in __init__
      self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 713, in _configure
      self._meson(
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 696, in _meson
      return self._proc('meson', *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\corea\AppData\Local\Temp\pip-build-env-_4nk1alw\overlay\Lib\site-packages\mesonpy\__init__.py", line 691, in _proc
      subprocess.check_call(list(args))
    File "C:\Users\corea\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=C:\\Users\\corea\\AppData\\Local\\Temp\\pip-install-ecec4diw\\scipy_3c6340d51124457a8297a77c748f217f\\.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=C:\\Users\\corea\\AppData\\Local\\Programs\\Python\\Python311', 'C:\\Users\\corea\\AppData\\Local\\Temp\\pip-install-ecec4diw\\scipy_3c6340d51124457a8297a77c748f217f', 'C:\\Users\\corea\\AppData\\Local\\Temp\\pip-install-ecec4diw\\scipy_3c6340d51124457a8297a77c748f217f\\.mesonpy-di88mzar\\build']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I have tried anaconda to install SciPy as well since I kept facing an issue. Yet it didnt resolve my problem.

jjjwad0x

jjjwad0x1#

1.安装C/C++编译器:错误日志表明系统找不到任何C/C编译器。如果您使用的是Windows,则可以从here下载并安装Microsoft的C Build Tools。
1.更新pipsetuptools:过时的版本有时会导致问题。打开命令提示符(cmd)并运行:

pip install --upgrade pip setuptools wheel

1.尝试重新安装SciPy:C/C++编译器和pip设置完成后,请再次尝试安装SciPy:

pip install scipy

1.Anaconda Option:由于您已经尝试过Anaconda,请确保您正在创建一个新环境,然后在该环境中安装SciPy:

conda create -n myenv python=3.11
conda activate myenv
conda install scipy

相关问题