(myenv1) root@p-VirtualBox:~/online-exam/onlineexam# pip install requirements.txt
Collecting requirements.txt
Exception:
Traceback (most recent call last):
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/root/online-exam/myenv1/lib/python3.6/site-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/root/online-exam/myenv1/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/requirements-txt/
发布于 2019-10-24 11:11:13
您缺少了-r
命令标志,因此再次使用以下命令:
pip install -r requirements.txt
和以前一样,pip
只是尝试从远程商店获取requirements-txt
,希望它是一个包名。
请参阅pip help install
用法: pip安装选项 包-索引-选项 .选项 -r 包-索引-选项 .pip还支持从“需求文件”进行安装,这提供了一种简单的方法来指定要安装的整个环境。安装选项:-r,--从给定的需求文件中安装需求。此选项可多次使用。
发布于 2020-10-31 02:22:52
pip3 install -r requirements.txt
或
pip install -r requirements.txt
会有帮助
https://askubuntu.com/questions/1180713
复制相似问题