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
#11
(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/
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#12
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#13
(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-o...6#pid40706
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#14
(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.
Recommended Tutorials:
Reply
#15
Hah! The ATMs are using Windows 95 as I know. I hope I am wrong.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#16
(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-o...6#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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#17
(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.
Reply
#18
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.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#19
(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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#20
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.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


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