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
#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


Messages In This Thread
RE: running other older versions of python - by snippsat - Feb-26-2018, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python App On Different Versions Harshil 3 2,405 Aug-25-2020, 04:14 PM
Last Post: snippsat
  multiple versions of Python Skaperen 6 3,030 Jun-13-2019, 12:32 AM
Last Post: Skaperen
  compiling various versions of Python, which toolchain? Skaperen 4 2,795 Jun-06-2019, 06:28 AM
Last Post: Skaperen
  many versions on python on linux Skaperen 8 5,851 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