简体   繁体   English

Linux Mint,Os脚本无法与多个Python版本一起使用

[英]Linux Mint, Os scripts wont work with multiple Python versions

some time ago I installed python 2.7.11 on my linux Mint. 前段时间,我在Linux Mint上安装了python 2.7.11。 Probably i did it wrong because now i have python 2.7.6 (default for Mint 17.3) and 2.7.11. 可能是我做错了,因为现在我有python 2.7.6(Mint 17.3的默认设置)和2.7.11。 The main problem is that my scripts tries to use newer version of python because symplink is set on it, and they dont work propertly. 主要问题是我的脚本尝试使用更新版本的python,因为在其上设置了symplink,并且它们无法正常工作。 For instance i cant install gi module for python 2.7.11 and OS requires that to run cinnamon-settings. 例如,我无法为python 2.7.11安装gi模块,并且OS要求运行肉桂设置。 How can i fix it? 我该如何解决?

You should try to specify a python version at the top of your script 您应该尝试在脚本顶部指定python版本

#!/usr/bin/python {version}

This should solve your problem 这应该可以解决您的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM