d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Python Version Clash
Add Reply New Topic New Poll
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 4 2013 09:28pm
i have python 2.7.3 installed in /scripts/Python-2.7.3
main version in /usr/lib/python-2.4

using centos5

if i replace 2.4 it'll break yum so that's why i'm using diff folder/install

how do I tell my script to use 2.7.3?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 4 2013 10:15pm
can't you do /scripts/Python-2.7.3/python.exe myscriptname.py? or if you're using some framework, i assume there's a config file somewhere pointing to python?
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 4 2013 10:53pm
Quote (carteblanche @ Dec 4 2013 10:15pm)
can't you do /scripts/Python-2.7.3/python.exe myscriptname.py? or if you're using some framework, i assume there's a config file somewhere pointing to python?


wasn't sure but i'll check it out
was hoping in the script i could just define what the path to python is there

might just setup a separate server to do this on
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 4 2013 11:57pm
Quote (0n35 @ Dec 4 2013 11:53pm)

was hoping in the script i could just define what the path to python is there



sounds a little odd to me. i mean, your interpreter has gotta run to enter the python script. not sure you can just terminate immediately and switch to another interpreter. that would typically be done in the .sh that calls your .py

but im no expert, so google around.
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 5 2013 12:14am
Quote (carteblanche @ Dec 4 2013 11:57pm)
sounds a little odd to me. i mean, your interpreter has gotta run to enter the python script. not sure you can just terminate immediately and switch to another interpreter. that would typically be done in the .sh that calls your .py

but im no expert, so google around.


Most people setup a bash profile and virtual host but that's just to run both versions no one really in the same boat
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 5 2013 06:01pm
lol
terminal do "python2.7 x.py"
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Dec 8 2013 05:37pm
Quote (0n35 @ Dec 5 2013 06:01pm)
lol
terminal do "python2.7 x.py"


Following up on this I highly suggest against using centos for python dev work it's a serious pain. Using Ubuntu raring I had all of python and my libs and my db setup in like 5-10 minutes
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll