从Requirements.txt脱机安装Pip错误



我正试图在没有互联网连接的Ubuntu虚拟机中安装Rasa(它是一个python pip包(。我使用requirements.txt完全离线安装rasa。requirements.txt和软件包(.whl文件(位于同一文件夹中。我使用以下命令:

pip install --no-index --find-links /home/...(folder with .whl files) -r requirements.txt

它收集依赖项,但在";tensorflow";包裹这是日志:

(venv) [user@ubuntuvm alldependencies]$ pip install --no-index --find-links /home/user/alldependencies/ -r requirements.txt
Looking in links: /home/user/alldependencies/
Processing ./absl_py-0.10.0-py3-none-any.whl
[ PROCESSING bla bla....]
Processing ./tensorboard-2.3.0-py3-none-any.whl
Processing ./tensorboard_plugin_wit-1.7.0-py3-none-any.whl
Processing ./tensorflow-2.3.1-py3-none-any.whl
ERROR: Exception:
Traceback (most recent call last):
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
status = self.run(options, args)
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
return func(self, options, args)
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/commands/install.py", line 324, in run
reqs, check_supported_wheels=not options.target_dir
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 391, in _resolve_one
dist = abstract_dist.get_pkg_resources_distribution()
File "/home/user/venv/lib64/python3.6/site-packages/pip/_internal/distributions/wheel.py", line 29, in get_pkg_resources_distribution
with ZipFile(self.req.local_file_path, allowZip64=True) as z:
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/zipfile.py", line 1108, in __init__
self._RealGetContents()
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/zipfile.py", line 1175, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

我能做什么?我安装了Python 3.6和最新的Pip版本(20.x(。

看起来tensorflow-2.3.1-py3-none-any.whl已损坏。可能的原因是:在下载或在磁盘上写入此文件时出现问题。很有可能再次下载它就能解决这个问题。

最新更新