简体   繁体   English

安装包后,Python中的请求不起作用

[英]Requests in Python doesn't work after installation package

So I've installed Python requests using these methods: 因此,我使用以下方法安装了Python请求:

$ git clone git://github.com/requests/requests.git

$ curl -OL https://github.com/requests/requests/tarball/master

$ cd requests $ pip install .

pip install requests

C:\Users\anonr>pip list
Package    Version
---------- --------
certifi    2019.3.9
chardet    3.0.4
idna       2.8
pip        19.0.3
requests   2.21.0
setuptools 40.8.0
urllib3    1.24.1

Which I found here: 我在这里找到的:

http://docs.python-requests.org/en/latest/user/install/ http://docs.python-requests.org/en/latest/user/install/

And I have requests on my packages in Python27/lib/site-packages/requests 我在Python27 / lib / site-packages / requests中的软件包上有请求

But when I try to use it on a script with import requests; 但是,当我尝试在具有import requests;的脚本上使用它时import requests; it doesn't work. 它不起作用。

Like I did not install it at all. 就像我根本没有安装它。

Does any one know how to fix this problem? 有谁知道如何解决这个问题? I tried reinstalling and installing again but still... 我尝试重新安装并再次安装,但仍然...

Please help. 请帮忙。

Do you use virtual environment? 您是否使用虚拟环境? Maybe problem is because you do not have installed requests package in virtual environment. 可能是因为您没有在虚拟环境中安装请求包。

您是否尝试过使用此方法:

pip install requests

您是否进行了标准的pip安装?

pip install requests

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM