在两个Python 3.x版本之间切换麻烦
我是Python的新手,我一直在尝试遵循他们的在线教程,该教程依赖于当前版本的Python 3.10。我已经尝试了几种解决方案,将3.9.12升级到最近的3.10.4,但所有调用Python默认值的模式都可以升级到3.9.12。
我使用的是Mac,我首先尝试将Homebrew与“ Brew Antern”一起使用,但我读到Homebrew尚未从3.9转换。接下来,我试图通过运行“ conda install python = 3.10.4”来通过Anaconda进行更新,但是Anaconda Navigator仍在为所有环境使用3.9。
我知道3.10.4已安装在我的计算机上。但是,我现在缺乏技能集,无法找出它的位置以及如何将默认设置更改为从3.10现在的任何地方进行调用。
感谢您的帮助!请让我知道我可以更改调用Python的默认版本(无论是在Anaconda中还是通过终端访问)。我发现了很多用于在Python2和Python3之间进行更改的资源,但在Python3版本之间切换并不多。
谢谢!!!!
I am new to Python, and I have been trying to follow their online tutorial which relies on the current version Python 3.10 being installed. I've tried several solutions to upgrade from 3.9.12 to the most recent 3.10.4, but all modes of calling python default to 3.9.12.
I am using a Mac, and I first tried to use homebrew with "brew install", but I've read that homebrew hasn't yet switched from 3.9. I next tried to update through Anaconda by running "conda install python=3.10.4", but Anaconda Navigator is still using 3.9 for all environments.
I know that 3.10.4 has been installed on my computer; however, I lack the skillset right now to find out where it is and how I can change the default to calling from wherever 3.10 is right now.
I would appreciate help with this! Please let me know ways that I could change the default version of python being called (whether in Anaconda or just through access via terminal). I've found a lot of resources for changing between python2 and python3, but not much for switching between python3 versions.
Thanks!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉康达(Conda),但我建议
pyenv
来解决这个确切的问题。pyenv
帮助您管理不同的python版本,并设置每个项目或每个shell的不同版本。当从事不同的项目或测试不同的分布时,这非常有用。您基本上使用
brew
像之类的然后使用这些步骤。 (这将取决于您的外壳)。
然后,您可以开始安装不同的版本,例如:
安装版本,可以设置全局,本地和外壳版本。
恕我直言,这是使用不同版本的最简单方法。
这是链接到官方repo ,我也建议 Realpython 的这篇文章,这可以更详细地解释这一切。
I'm not familiar with Conda, but I would recommend
pyenv
to solve this exact problem.pyenv
helps you manage different Python versions, and set different versions per project, or per shell. This is very useful when working on different project or testing different distributions.You basically install with
brew
likeThen set your environment, with these steps. (It will depend on your shell).
Then you can start installing different versions like:
With versions installed, you can set the global, local and shell versions.
IMHO it's the easiest way to work with different versions.
Here's the link to the official repo, and I would also suggest this article from RealPython, that's explains it all in much greater detail.