1,查看当前python 版本

python -v 小写v:这是版本信息,包括库版本

python -V 大写v:只看python的版本

which python3    查看安装路径

 

2,修改~/.bash_profile文件

 

# Setting PATH for Python 3.8

# The orginal version is saved in .bash_profile.pysave

PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"

export PATH 
 ### //增加这几行内容(如有则无需添加)

 alias python2='/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7'

 alias python3='/Library/Frameworks/Python.framework/Versions/3.8/bin/python3'

 alias python=python3

 

3,使得修改的 bash_profile文件 生效

source ~/.bash_profile


其他
引用格式:
from 包名.文件名 import 类名

4. 安装包到python3下
pip3 install XXXX
python3 -m pip install ****

相关文章:

  • 2021-09-18
  • 2021-05-15
  • 2021-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-10-09
  • 2021-09-16
  • 2021-08-23
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案