本地venv pip install scipy报错如下:
(venv) D:\Desktop\TF-word2vec-textCNN文本分类>pip install scipy
Collecting scipy
Using cached scipy-1.10.1.tar.gz (42.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 2
╰─> [27 lines of output]
+ meson setup --prefix=D:\Users\zhouteng\AppData\Local\Programs\Python\Python39-32 C:\Users\zhouteng\AppData\Local\Temp\pip-install-u35quwpt\scipy_2a235f90b96e48988a292655b43a243d C
:\Users\zhouteng\AppData\Local\Temp\pip-install-u35quwpt\scipy_2a235f90b96e48988a292655b43a243d\.mesonpy-2kbr4kjz\build --native-file=C:\Users\zhouteng\AppData\Local\Temp\pip-install-u35q
uwpt\scipy_2a235f90b96e48988a292655b43a243d\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
Traceback (most recent call last):
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\mesonmain.py", line 194, in run
return options.run_func(options)
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\msetup.py", line 318, in run
app.generate()
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\msetup.py", line 189, in generate
env = environment.Environment(self.source_dir, self.build_dir, self.options)
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\environment.py", line 508, in __init__
config = coredata.parse_machine_files(self.coredata.config_files)
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\coredata.py", line 1013, in parse_machine_files
parser = MachineFileParser(filenames)
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\coredata.py", line 959, in __init__
self.parser.read(filenames)
File "C:\Users\zhouteng\AppData\Local\Temp\pip-build-env-71x1wfcu\overlay\Lib\site-packages\mesonbuild\coredata.py", line 947, in read
return super().read(filenames, encoding)
File "D:\Users\zhouteng\AppData\Local\Programs\Python\Python39-32\lib\configparser.py", line 697, in read
self._read(fp, filename)
File "D:\Users\zhouteng\AppData\Local\Programs\Python\Python39-32\lib\configparser.py", line 1020, in _read
for lineno, line in enumerate(fp, start=1):
File "D:\Users\zhouteng\AppData\Local\Programs\Python\Python39-32\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 54: invalid continuation byte
ERROR: Unhandled python exception
This is a Meson bug and should be reported!
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
csdn里查的说python版本与安装库的版本不一致报错:
然而,2023.5.23 用pip install scipy下载的是最新版scipy1.10.1,在window上最低支持python3.8,而我是python3.9.6,这???版本没问题啊。而且,我anaconda里有一个虚拟环境是python3.9.12,也是pip install scipy,成功下载了scipy1.10.1,并没有上述的报错(上述是项目本地的venv虚拟环境)
不管怎样,我换了一个低版本的scipy,pip install scipy==1.7.3,没有报错,正常的。
怎么看scipy1.10.1支持哪些版本的python(其它包同理):
去官网 https://pypi.org/ 搜索scipy,选择scipy的版本1.10.1,点击左侧栏的Download files,然后就能看到它支持哪些版本的python了。