更改python版本

Python plays a major role at Mozilla; much of our website backends and tooling are written in the powerful language.  Want to build Firefox?  You'll need to make sure you have the proper Python version, which I recently found out had been upgraded.

Python在Mozilla中起着主要作用; 我们的许多网站后端和工具都是使用功能强大的语言编写的。 要构建Firefox吗? 您需要确保您拥有正确的Python版本,而我最近发现该版本已经升级。

Despite installing and verifying I had the version of python I needed, the default version was still an older version and the build was failing.  I know that there are python version managers and symlinking tricks, but I wanted the easiest and most explicit possible way to set a default python version, and I did it with an entry to ~/.bash_profile:

尽管已安装并验证我是否拥有所需的python版本,但默认版本仍旧为旧版本,并且构建失败。 我知道有python版本管理器和符号链接技巧,但是我想要最简单,最明确的方法来设置默认的python版本,我使用~/.bash_profile的条目来做到这一点:


alias python='python3'


The directive above sends python calls to python3 and thus I can specify the python version with this entry.  There are many ways to accomplish this goal but this one works great for me!

上面的指令将python调用发送到python3 ,因此我可以使用此条目指定python版本。 有很多方法可以实现这一目标,但是这一方法对我来说非常有用!

翻译自: https://davidwalsh.name/change-python-version

更改python版本

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐