[英]How to set the default python3 to python3.9 in Linux via aliases?
[英]How to set Python3.9 the default for python3 on mac?
我之前的 python3.7 由 Anaconda 安装,然后我使用自制软件安装了 python3.9。 然后事情就真的一团糟了。 当我使用pip3 list
检查我的包时,它显示没有安装任何包。 我想它是在 python3.9 下采购站点包。 但是,当我在终端( which python3
)中运行 python 时,它表明我仍在运行旧的 python3.7 ,其中包含我所有的包。 问题是每当我安装新包时,它都不起作用,因为我仍在运行旧的 python3.7,而新包安装到 python3.9。
问题:
非常感谢!
列出您安装的 pip 软件包:
pip3 freeze > my_packages.txt
卸载python3.7:
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.7
使用新安装的 python3.9,安装以前的包:
pip3 install -r my_packages.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.