python3 版本问题
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# pip3 --versionpip 19.2.3 from /usr/local/python3" title="python3">python3/lib/python3.7/site-packages/pip (python 3.7)
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# ls
geetest.py img_locate.py js __pycache__ Python-3.7.0 Python-3.7.0.tgz readme.md run.py trace.py
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# ls
geetest.py img_locate.py js __pycache__ Python-3.7.0 Python-3.7.0.tgz readme.md run.py trace.py
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# python3 run.py
Traceback (most recent call last):
File "run.py", line 1, in <module>
import geetest
File "/root/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest/geetest.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# pip3 list |grep requests
requests 2.22.0
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest#
Python 3.7.4 (default, Jul 14 2019, 18:21:55)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
>>> ^Z
[8]+ Stopped python3
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# python3 --version
Python 3.7.4
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest# pip3 list
Package Version
---------- ---------
certifi 2019.6.16
chardet 3.0.4
idna 2.8
pip 19.2.3
requests 2.22.0
setuptools 39.0.1
urllib3 1.25.3
root@miaowo:~/stephen/geetest/Lengyue-Vcode/滑动验证码/Geetest#
我pip3里面有requests但是我运行的时候没有,这是为啥?
回答:
可能你其他地方还有python3?你试一下运行which python3,看显示的什么路径
以上是 python3 版本问题 的全部内容, 来源链接: utcz.com/a/158587.html