Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议修改python脚本的解释器为"/usr/bin/env python" #25

Open
cjybyjk opened this issue May 6, 2018 · 3 comments
Open

建议修改python脚本的解释器为"/usr/bin/env python" #25

cjybyjk opened this issue May 6, 2018 · 3 comments

Comments

@cjybyjk
Copy link

cjybyjk commented May 6, 2018

目前部分python脚本中将解释器指向了"/usr/bin/python",这对部分用户(比如使用virtualenv进行python版本切换的)造成了不便。
因此建议将解释器修改为"/usr/bin/env python"或者"/usr/bin/env python2"
Google的repo脚本使用的是/usr/bin/env python2作为解释器

@ajunzhang
Copy link

linux系统默认的是python2.6,我在/usr/local安装了python2.7。设置了软连接。python --version以及/usr/bin/python 都指向Python2.7.但是/usr/bin/env python 却是指向python2.6。请问如何设置将/usr/bin/env python 指向python2.7

@cjybyjk
Copy link
Author

cjybyjk commented Jun 17, 2018

@ajunzhang virtualenv 或者 export PATH=/path/to/python2:$PATH

@ajunzhang
Copy link

是的,我又对/usr/bin/python2 设置了软链接指向 pyhton2.7就ok了。发现/usr/bin/env pyhton读取的是/usr/bin/python2的配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants