Python Forum
running other older versions of python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
running other older versions of python
#1
i'd like to run other, older, versions of Python to test code that is intended to be version agnostic so that it is known how wide a range of Python versions it can run on, and allow testing code changes to increase that range.

it might be a good idea to create virtual machines for each version so each can have just one and only one version of Python.

i am doing all this with Linux. to the extent the chosen distro is independent of the version of Python, that would be among the choices. i think Ubuntu is this way. i know Slackware is since it uses no Python in its system code. so i might be doing this with Ubuntu or Slackware.

i don't use Windows and do not even have a copy of it. if it turns out i want to run tests under Windows, i'll probably run short term cloud instances on AWS or Azure.

at this point, i am curious if anyone has tried running various versions of Python different than what is normally available to you on the system you run Python on.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Why vm' when you can create a virtual environment?

$ virtualenv -p /usr/bin/python3.4 env34
This will create env34 with interpreter version 3.4.

I don't know if this will work for Python 0.9.1 but you can try Cool
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
i'm not going back as far as python 0.9.1. just back to 2.4 or maybe 2.3 ... up to 2,7. and for 3.x just 3.3 to the latest.

can i have the script to be run in virtualenv be located anywhere in the system? i have never tried virtualenv and have no idea (yet) how it works.

if i install all these python versions ... 2.4,2.5,2.6,2.7,3.3,3.4,3.5,3.6 how do i keep them from getting mixed up?

does virtualenv bring in (install) what is needed for the environment it is creating or does this require those versions be already installed?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
You open the terminal and activate the virtual environment. The script could be located anywhere.

About the installation of different Python versions...

If you list /usr/bin/ you will see a folder for any python version you have installed now. You should. Mixing the versions is not possible. As I see it.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#5
From all of the posts in the past year, I don't believe I have seen one for anything
older than 2.7. Possibly one in the entire year for 2.6. Why waste time on something
that is totally unnecessary, and will most likely never be used.

Isn't that kind of like building a repair kit for a crank telephone?
Reply
#6
(Feb-26-2018, 03:33 AM)Skaperen Wrote: if i install all these python versions ... 2.4,2.5,2.6,2.7,3.3,3.4,3.5,3.6 how do i keep them from getting mixed up?
I have told you about pyenv before,but you to not always listen Wink
mint@mint ~ $ pyenv install --list
Available versions:
  2.1.3
  2.2.3
  2.3.7
  2.4
  2.4.1
  2.4.2
  2.4.3
  2.4.4
  2.4.5
  2.4.6
  2.5
.... to 3.6.4 and 3.8 dev
Install 2.4 and set is as global system version.
mint@mint ~ $ pyenv install 2.4
Downloading Python-2.4.tgz...
-> https://www.python.org/ftp/python/2.4/Python-2.4.tgz
Installing Python-2.4...
Installed Python-2.4 to /home/mint/.pyenv/versions/2.4

Downloading pip-1.1.tar.gz...
-> https://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz
Installing pip-1.1...
Installed pip-1.1 to /home/mint/.pyenv/versions/2.4

mint@mint ~ $ pyenv global 2.4
mint@mint ~ $ which python
/home/mint/.pyenv/shims/python
mint@mint ~ $ python -V
Python 2.4

mint@mint ~ $ pip --version 
pip 1.1 from /home/mint/.pyenv/versions/2.4/lib/python2.4/site-packages/pip-1.1-py2.4.egg (python 2.4
Back to early days with pip 1.1 Cool
So now is 2.4 the main system version.
Test a feature that was new in 2.5 with open and get syntax error in 2.4.
mint@mint ~ $ python
Python 2.4 (#1, Feb 26 2018, 14:34:49) 
[GCC 5.4.0 20160609] on linux4
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('foo') as f:
  File "<stdin>", line 1
    with open('foo') as f:
            ^
SyntaxError: invalid syntax
>>> 
Skaperen Wrote:i am curious if anyone has tried running various versions of Python different than what is normally available to you on the system you run Python on.
It's part of my normal workflow,example always when doing web-development i will have it virtual environment.
pipenv is what i use most it's greeat,in 3.6 so in also virtual environment build in trough venv
Also sometime VirtualBox, Docker, Anaconda, DigitalOcean, Cloud9.
Reply
#7
Version 2.6 support stopped in 2016. I do not see any need of trying anything on older than 2.7 version. Practical need. If you are curious... that is another thing. I don't even bother with 2.7. At all.

Live is too short.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#8
are you sure that all systems in the world that were running python2.6 or older have upgraded to python2.7, including those running a local app written for python2.6 that fails in python2.7 at a business too cheap to hire someone to upgrade that app?

before i install pyenv, i want to understand how it works, otherwise i'm back to VMs to keep things safe. i am unable to download stuff from github (got a better URL?).

i see in "man virtualenv" where it says """a shell script called "activate" will be installed in the bin directory""". which bin directory? /bin?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#9
(Feb-27-2018, 02:34 AM)Skaperen Wrote: before i install pyenv, i want to understand how it works, otherwise i'm back to VMs to keep things safe. i am unable to download stuff from github (got a better URL?).
It's safe,have no other url(and no other url should used be of security).
Quote:i see in "man virtualenv" where it says """a shell script called "activate" will be installed in the bin directory""". which bin directory? /bin?
Explain it here(even a image with arrows) Rolleyes Linux Python 3 environment
Reply
#10
i know what a virtual machine is. i've worked with them since 1976.

in Unix/Linux another kind of environment i have used for a couple decades is chroot (the BSD community calls it a "jail").

i already understand the details of these environments. i need to understand the details of an environment created by virtualenv. telling me that it is safe does not fulfill my need to know. i need to know all the details.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python App On Different Versions Harshil 3 2,354 Aug-25-2020, 04:14 PM
Last Post: snippsat
  multiple versions of Python Skaperen 6 2,939 Jun-13-2019, 12:32 AM
Last Post: Skaperen
  compiling various versions of Python, which toolchain? Skaperen 4 2,719 Jun-06-2019, 06:28 AM
Last Post: Skaperen
  many versions on python on linux Skaperen 8 5,740 Oct-17-2017, 02:22 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020