Using python3
On OSX I installed requests using pip3 install requests
When I run >>>python -c "import requests"
, no errors, but when I run a file started with import requests
, I get the following error:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import requests
ImportError: No module named 'requests'
Stumped.
原来我正在用python 2运行该文件,但是已经在python 3(pip3)下安装了请求。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.