如何使bash脚本使用特定的python版本执行python脚本? [英] How to make bash script use a particular python version for executing a python script?
本文介绍了如何使bash脚本使用特定的python版本执行python脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Freebsd盒子上安装了python 2.6和python.我希望我的bash脚本使用python2.6解释器执行特定的python脚本.它显示导入错误.未定义的符号"PyUnicodeUCS2_DecodeUTF8"
I have python 2.6 and python installed on my Freebsd box. I want my bash script to execute a particular python script using python2.6 interpreter. It is showing import error.... Undefined symbol "PyUnicodeUCS2_DecodeUTF8"
推荐答案
这可能是由于以下原因引起的.
It is probably caused by the following.
您的脚本会导入一些由较旧的python版本编译的第三方库.
Your script imports some third-party library which was compiled by an older python version.
要解决此问题,请重新安装最新的库.
To fix this, reinstall the up-to-date library.
这篇关于如何使bash脚本使用特定的python版本执行python脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文