错误:由于OSError,无法安装程序包



我有错误,请告诉我这是怎么回事,我在任何地方都找不到解决方案!

我正在处理一个项目,但当其他成员尝试安装-r requirements.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:usersketananaconda3libsite-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:usersketananaconda3libsite-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:Usersketananaconda3python.exe' 'C:Usersketananaconda3libsite-packagespip_vendorpep517in_process_in_process.py' build_wheel 'C:Usersketa
nAppDataLocalTemptmp4t2qkb8i'
cwd: C:UsersketanAppDataLocalTemppip-install-sqrcce6sbottleneck_b15ec4cdd7084e748dc7a963008d04b3
Complete output (51 lines):
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.8
creating buildlib.win-amd64-3.8bottleneck
copying bottleneck_pytesttester.py -> buildlib.win-amd64-3.8bottleneck
copying bottleneck_version.py -> buildlib.win-amd64-3.8bottleneck
copying bottleneck__init__.py -> buildlib.win-amd64-3.8bottleneck
creating buildlib.win-amd64-3.8bottleneckbenchmark
copying bottleneckbenchmarkautotimeit.py -> buildlib.win-amd64-3.8bottleneckbenchmark
copying bottleneckbenchmarkbench.py -> buildlib.win-amd64-3.8bottleneckbenchmark
copying bottleneckbenchmarkbench_detailed.py -> buildlib.win-amd64-3.8bottleneckbenchmark
copying bottleneckbenchmark__init__.py -> buildlib.win-amd64-3.8bottleneckbenchmark
creating buildlib.win-amd64-3.8bottleneckslow
copying bottleneckslowmove.py -> buildlib.win-amd64-3.8bottleneckslow
copying bottleneckslownonreduce.py -> buildlib.win-amd64-3.8bottleneckslow
copying bottleneckslownonreduce_axis.py -> buildlib.win-amd64-3.8bottleneckslow
copying bottleneckslowreduce.py -> buildlib.win-amd64-3.8bottleneckslow
copying bottleneckslow__init__.py -> buildlib.win-amd64-3.8bottleneckslow
creating buildlib.win-amd64-3.8bottlenecksrc
copying bottlenecksrcbn_config.py -> buildlib.win-amd64-3.8bottlenecksrc
copying bottlenecksrcbn_template.py -> buildlib.win-amd64-3.8bottlenecksrc
copying bottlenecksrc__init__.py -> buildlib.win-amd64-3.8bottlenecksrc
creating buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsinput_modification_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestslist_input_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsmemory_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsmove_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsnonreduce_axis_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsnonreduce_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsreduce_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsscalar_input_test.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktestsutil.py -> buildlib.win-amd64-3.8bottlenecktests
copying bottlenecktests__init__.py -> buildlib.win-amd64-3.8bottlenecktests
UPDATING buildlib.win-amd64-3.8bottleneck/_version.py
set buildlib.win-amd64-3.8bottleneck/_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'.

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

pip uninstall numpy
pip install numpy==1.19.3

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

最新更新