错误:由于操作系统错误而无法安装软件包?

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

我收到错误,请告诉我这有什么问题,我无法在任何地方找到解决方案!

我正在开发一个项目,但是当其他成员尝试使用 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 -rrequirements.txt --ignore-installed

输出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 安装 numpy==1.19.3 输出3:

$ 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'.
python python-3.x requirements
2个回答
0
投票

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

pip uninstall numpy

pip install numpy==1.19.3

0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.