linux系统pip默认使用python2,想使用python3解释器

能用代码说明一切就无需文字。

hellopython@ubuntu:/usr/bin$ pip3 freeze

Command 'pip3' not found, but can be installed with:

sudo apt install python3-pip

hellopython@ubuntu:/usr/bin$ sudo apt install python3-pip
hellopython@ubuntu:/usr/bin$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
hellopython@ubuntu:/usr/bin$ pip3 install selenium
Successfully installed selenium-3.141.0 urllib3-1.25.7

hellopython@ubuntu:/usr/bin$ pip3 show selenium
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: /home/hellopython/.local/lib/python3.6/site-packages
Requires: urllib3

hellopython@ubuntu:/usr/bin$ whereis python3
python3: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3 /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/lib/python3.6 /usr/lib/python3 /usr/lib/python3.7 /usr/lib/python3.8 /etc/python3.6 /etc/python3 /usr/local/lib/python3.6 /usr/include/python3.6 /usr/include/python3.6m /usr/share/python3 /usr/share/man/man1/python3.1.gz

hellopython@ubuntu:/usr/bin$ pip3 freeze
apturl==0.5.2
python-dateutil==2.6.1
python-debian==0.1.32
pytz==2018.3
pyxdg==0.25
PyYAML==3.12
reportlab==3.4.0
requests==2.18.4
requests-unixsocket==0.1.5
SecretStorage==2.3.1
selenium==3.141.0
.......
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页