我需要安装模块“ Request”,但是当我运行命令时 pip3安装请求 它给了我这个错误:
这是我运行程序所需要的:
Collecting Request
Installing collected packages: Request
ERROR: Exception:
Traceback (most recent call last):
File "/root/.local/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/root/.local/lib/python3.5/site-packages/pip/_internal/commands/install.py", line 414, in run
use_user_site=options.use_user_site,
File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs
**kwargs
File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 920, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/root/.local/lib/python3.5/site-packages/pip/_internal/req/req_install.py", line 448, in move_wheel_files
warn_script_location=warn_script_location,
File "/root/.local/lib/python3.5/site-packages/pip/_internal/wheel.py", line 428, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: Request .dist-info directory not found
这是我尝试通过终端中的pip3安装请求模块时得到的:
pip install Request
如果我跑步
e1
它告诉我已经满足要求,但是当我运行程序时,它说模块Request丢失了。
答案 0 :(得分:2)
您不需要安装urllib.request.Request
。自3.3版以来,它已成为Python的一部分。您可能会想到requests,如果要使用它,还需要安装其他东西。
答案 1 :(得分:-1)
我清理了python安装2和3,并从零重新安装。看来我的文件夹被弄乱了,并且在错误的路径中搜索了软件包。
apt-get remove python
apt-get install python
答案 2 :(得分:-2)
使用apt-get install python3-requests
。出现该错误是因为您的所有python3.x库均未更新。
顺便说一句,重复的问题,请使用搜索功能:How to install requests module in Python 3.4, instead of 2.7