Python Forum
running other older versions of python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: running other older versions of python (/thread-8539.html)

Pages: 1 2 3


RE: running other older versions of python - wavic - Feb-27-2018

(Feb-27-2018, 02:34 AM)Skaperen Wrote: i see in "man virtualenv" where it says """a shell script called "activate" will be installed in the bin directory""". which bin directory? /bin?

This script is installed in ./MY_VIRT_ENV/bin/: https://virtualenv.pypa.io/en/stable/userguide/


RE: running other older versions of python - Skaperen - Feb-28-2018

ah... so you do need root permissions, or write access to / to set this up.

my first big question about virtualenv remains unanswered by that user guide: how to set up virtual environments for other versions of python so i don't have to go build virtual machines.

it still looks like a virtual machine is the way to go.


RE: running other older versions of python - wavic - Feb-28-2018

(Feb-28-2018, 01:17 AM)Skaperen Wrote: my first big question about virtualenv remains unanswered by that user guide: how to set up virtual environments for other versions of python

https://python-forum.io/Thread-running-other-older-versions-of-python?pid=40706#pid40706


RE: running other older versions of python - metulburr - Feb-28-2018

(Feb-27-2018, 02:34 AM)Skaperen Wrote: 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?
That sounds like American businesses for sure Tongue

people are still using older versions they shouldnt be. In fact someone posted here awhile ago asking for help with 2.5 or 2.6 and was not able to upgrade the system.


RE: running other older versions of python - wavic - Feb-28-2018

Hah! The ATMs are using Windows 95 as I know. I hope I am wrong.


RE: running other older versions of python - Skaperen - Mar-01-2018

(Feb-28-2018, 02:43 AM)wavic Wrote:
(Feb-28-2018, 01:17 AM)Skaperen Wrote: my first big question about virtualenv remains unanswered by that user guide: how to set up virtual environments for other versions of python

https://python-forum.io/Thread-running-other-older-versions-of-python?pid=40706#pid40706

so i must first install that version of python on the system? ... back to doing VMs so that i do not have a mix of version 2 and/or a mix of version 3 ... e.g. i do not want a mix of minor versions which might confuse some scripts.


RE: running other older versions of python - snippsat - Mar-01-2018

(Mar-01-2018, 01:51 AM)Skaperen Wrote: so i must first install that version of python on the system? ... back to doing VMs so that i do not have a mix of version 2 and/or a mix of version 3 ... e.g. i do not want a mix of minor versions which might confuse some scripts.
As mention before so do pyenv solve this as you can install all version from 2.1 to 3.8(or PyPy Anaconda) in safe way.
It do not mess with what's already installed as OS Python as you can type pyenv local system and back to default setup that distro has.

So VM's or other messy stuff like install to OS,is needed if don't want use a easy version management like pyenv.


RE: running other older versions of python - wavic - Mar-01-2018

I don't think that the minor version will be mixed. This is why I wrote in a prev. post here to list /usr/bin/ for example. During the installation, a separate folder is created for each version. I remember that this happened to me once when I installed another Python version in addition to the standard major versions which come with the system. If you have installed python2.7 and python3.6 there will be folders in /usr/bin/ with the same names. If you install python3.5 the corresponding directory will appear along the others. I will try it later on my Arch.

Then you create the environment pointing to the exact version you want:

$ virtualenv -p /usr/bin/python3.5/python3.5 my_3.5_env

If you have anaconda installed you can point to its python version

$ virtualenv -p /home/$USER/anaconda/bin/python

For example.

Doesn't matter if you install any python version you want. Mixing is impossible. Let say you have installed 2.6, 2.7, 3.4, 3.5 and 3.6.
In .bashrc you just create an alias for each version:

# .bashrc
....
....
# another content

alias p2.6="/usr/bin/python2.6/python2.6"
alias p2.7="/ust/bin/python2.7/python2.7"
alias p3.4="/usr/bin/python3.4/python3.4"
alias p3.5="/usr/bin/python3.5/python3.5"
alias p3.6="/usr/bin/python3.6/python3.6"

Then you can install virtualenvwrapper and do something like:

$ mkvirtualenv -p p3.4 my_3.4_env

Anyway, I've never used this.


RE: running other older versions of python - Skaperen - Mar-02-2018

(Mar-01-2018, 07:36 AM)snippsat Wrote: So VM's or other messy stuff like install to OS,is needed if don't want use a easy version management like pyenv.
but pyenv also needs install to OS ... install of other versions of Python to my primary OS, which i do not want to do.

there are 8 different versions of Python i have identified that i want to have running (2.4, 2.5, 2.6, 2.7, 3.3, 3.4, 3.5, 3.6). since i don't want a mix (until i have tested everything in a mix) that means at least one virtual machine (a mix there is OK). but once i do that, it is easy enough to duplicate VMs to have 8 VMs and install just one version of Python on each. the reson i would have 8 VMs instead of 6 is so that i can run what i have on my main system each in a VM for very consistent comparison and the ability to easily test if the VM, its guest OS, or its installation of Python (probably a compile from source) is the cause of an issue. 9 VMs when 3.7 is released.


RE: running other older versions of python - wavic - Mar-02-2018

If you want to make a VM and try to install all Python versions you want and see what will happen. I am curious too if there will be mixing or not.