1

I have several programs written for Python 2.6. When I downloaded Python 3.0 the programs wouldn't run. I'd like to have both versions on my computer and be able to run my 2.6 programs by default. Then, for new programs, I'd like to switch to 3.0.

How can I do this, or can I do it at all?

Thank you.

4
Contributors
3
Replies
6
Views
8 Years
Discussion Span
Last Post by scru
0

I have a symlink from /usr/bin/python to python2.5 as the default. If I want to use 2.6 or 3.x I simply use the shebang
#!/usr/bin/python3.0
They install into different library directories, so multiple versions isn't problem.

0

If you use Windows, you can write a batch file to force an IDE like IDLE to use Python30 this way ...

REM a batch file to force IDLE to use Pyhon30
REM saved as IDLE30.bat
C:\Python30\pythonw.exe -u C:\Python30\Lib\idlelib\idle.pyw

Conversely you can do the a similar thing for Python26 ...

REM a batch file to force IDLE to use Pyhon26
REM saved as IDLE26.bat
C:\Python26\pythonw.exe -u C:\Python26\Lib\idlelib\idle.pyw

Then you can make desktop icons for the two batch files.

0

Also on windows, doing a "repair" in the control panel Add/remove programs on the version you want will set it as the default.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.