Mac OS10.13.6 設置python3為默認環境

Since Odoo has been upgraded from Python 2 to Python 3, the environment we use most during development is Python 3, while the Python 2 environment is gradually being used less.
First, open the terminal

Second, cd ~ to the current user directory
Third, open .bash_profile to open the file. We actually need to modify the file, but the problem is that there is no .bash_profile file in the current directory.
Fourth, touch .bash_profile to create one
Fifth, use the vim command to open the .bash_profile file and directly add the script

alias python="/usr/local/bin/python3" //Default path installed using brew install python3 alias pip="/usr/local/bin/pip3" //Default pip3 path installed using brew install python3

Then save and exit. Alternatively, we can use open .bash_profile to pop up the editing window, add the content, and then press command+s to save and close the window.
Sixth, implementation brings it into effect.
source .bash_profile
Finally, when we input in the terminal with Python, we see that the default version is 3.7.

关于我们

​我们致力于帮助中小企业实现数字化转型,我们的团队由一群充满激情和创新思维的专业人士组成,他们具备丰富的行业经验和技术专长。

扫一扫获取顾问以及手册

归档
登入 發表評論
odoo14網站頁腳Powered by關閉
快速關閉odoo14頁腳版權信息