python-3.x 错误:由于OSError,无法安装软件包?

ozxc1zmp  于 2023-11-20  发布在  Python
关注(0)|答案(2)|浏览(166)

我得到错误请告诉我这是什么问题,我无法找到解决方案的任何地方!
我在一个项目上工作,但当其他成员尝试使用install -r rquirements.txt时,他们得到了这个错误!请告诉应该采取什么行动来处理或删除这个错误?

ERROR: Could not install packages due to an OSError: [Errno 2] 
No such file or directory: 'c:\\users\\ketan\\anaconda3\\lib\\site-packages\\numpy-1.21.2.dist-info\\ME
TADATA'

字符串
输出量:

Collecting Werkzeug==2.0.2
Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Requirement already satisfied: wheel==0.37.0 in c:\users\ketan\anaconda3\lib\site-packages (from -r requirements.txt (line 93)) (0.37.0)
Collecting win32-setctime==1.0.3
  Using cached win32_setctime-1.0.3-py3-none-any.whl (3.5 kB)
Requirement already satisfied: wincertstore==0.2 in c:\users\ketan\anaconda3\lib\site-packages (from -r requirements.txt (line 95)) (0.2)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'c:\\users\\ketan\\anaconda3\\lib\\site-packages\\numpy-1.21.2.dist-info\\ME
TADATA'


pip install -r requirements.txt --已重新安装
输出2:

Collecting tbb==2021.*
  Using cached tbb-2021.4.0-py3-none-win_amd64.whl (268 kB)
Building wheels for collected packages: bottleneck
  Building wheel for bottleneck (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\ketan\anaconda3\python.exe' 'C:\Users\ketan\anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\keta
n\AppData\Local\Temp\tmp4t2qkb8i'
       cwd: C:\Users\ketan\AppData\Local\Temp\pip-install-sqrcce6s\bottleneck_b15ec4cdd7084e748dc7a963008d04b3
  Complete output (51 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\bottleneck
  copying bottleneck\_pytesttester.py -> build\lib.win-amd64-3.8\bottleneck
  copying bottleneck\_version.py -> build\lib.win-amd64-3.8\bottleneck
  copying bottleneck\__init__.py -> build\lib.win-amd64-3.8\bottleneck
  creating build\lib.win-amd64-3.8\bottleneck\benchmark
  copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.8\bottleneck\benchmark
  copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.8\bottleneck\benchmark
  copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.8\bottleneck\benchmark
  copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.8\bottleneck\benchmark
  creating build\lib.win-amd64-3.8\bottleneck\slow
  copying bottleneck\slow\move.py -> build\lib.win-amd64-3.8\bottleneck\slow
  copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.8\bottleneck\slow
  copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.8\bottleneck\slow
  copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.8\bottleneck\slow
  copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.8\bottleneck\slow
  creating build\lib.win-amd64-3.8\bottleneck\src
  copying bottleneck\src\bn_config.py -> build\lib.win-amd64-3.8\bottleneck\src
  copying bottleneck\src\bn_template.py -> build\lib.win-amd64-3.8\bottleneck\src
  copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.8\bottleneck\src
  creating build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\util.py -> build\lib.win-amd64-3.8\bottleneck\tests
  copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.8\bottleneck\tests
  UPDATING build\lib.win-amd64-3.8\bottleneck/_version.py
  set build\lib.win-amd64-3.8\bottleneck/_version.py to '1.3.2'
  running build_ext
  running config
  compiling '_configtest.c':
  
  
  
  int __attribute__((optimize("O3"))) have_attribute_optimize_opt_3(void*);
  
  int main(void)
  {
      return 0;
  }
  
  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 bottleneck
Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly


pip install numpy==1.19.3 Output3:

$ pip install numpy==1.19.3
Collecting numpy==1.19.3
  Using cached numpy-1.19.3-cp38-cp38-win_amd64.whl (13.3 MB)
WARNING: Error parsing requirements for numpy: [Errno 2] No such file or directory: 'c:\\users\\ketan\\anaconda3\\lib\\site-packages\\numpy-1.21.2.dist-info\\METADATA
'
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.21.2
ERROR: Cannot uninstall numpy 1.21.2, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps numpy==1.21.2'.

btqmn9zl

btqmn9zl1#

尝试使用旧版本的NumPy,它应该可以工作。

pip uninstall numpy

pip install numpy==1.19.3

字符串

kqhtkvqz

kqhtkvqz2#

当使用Windows操作系统与python时,许多python包和库需要Microsoft Build Tools来编译和安装包。您必须下载Visual Studio来安装Microsoft Build Tools。此外,还要在Visual Studio中安装C++依赖项。

相关问题