Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 multiple versions of Python
#1
when i compile a different version of Python from source and try to install it, will i try to replace any file of the existing version? or will it keep each version separate? this is on Ubuntu Linux 16.04.6 which has /usr/bin/python3.5 (not /usr/bin/python3.5.2). does do this naming scheme only with the major,minor numbers and avoid the bugfix numbers?
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#2
You can configure it to do what you want, I'm not sure what the default is.
I would just use pyenv for installing multiple versions.
Quote
#3
apparently pyenv creates an "environment" of some kind in a subdirectory and you have to activate it in each shell session. but you cannot have 2 or more concurrent activations. checking each script to see what version it uses then activating that version is not a practical way to use scripts. environments is not the way to go for what i am planning to do. basically, i need to have each version in /usr/bin and other system directories. i do have 2 versions now and can use either one by just specifying which version in the #! line (the first line) of the script.

i'm still trying to find out what kind of environment pyenv creates so i can evaluate how it might be made usable. who here really knows? this is on Ubuntu Linux 16.04.6.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#4
It basically creates a whole new installation in a folder.

It then gives you the ability to choose which executables python and pip (maybe others as well?) refer to.
This can be chosen both globally and for a single directory (and subdirectories).

There are more details on github.

AFAICT shebangs should work as expected.
Quote
#5
what does "whole new installation in a folder" really mean for this? is it just those files or is it a container? can i chroot into their and run everything on that version?

i'm not going to hunt around on github.

how does env find pythonX in the folder?
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#6
You can see it on the syscalls, if you start python with strace.
The place of the binary is the starting point. Then Python tries all relative
known paths to open the resources.

Here the stacktrace:

Aditionally command line parameters and environment variables define which paths the Python interpreter is using.
You have the same behaviour with virtual environments. In the case the difference is, that the files are symlinks.
Pyenv downloads Python from github, compiles it and installs it.
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote
#7
how does it get to .pyenv/versions/3.7.3/bin/python at the start? my scripts will have #!/usr/bin/env python3.7 or the like. does this set up a symlink at /usr/bin/python3.7? it might be possible that a script has #!/usr/bin/python3.7.

and i already have every version of source. no need to download again. but, at least compiling should make it work on ARM64 architectures.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  compiling various versions of Python, which toolchain? Skaperen 4 187 Jun-06-2019, 06:28 AM
Last Post: Skaperen
  versions ending with .0 Skaperen 2 135 Jun-05-2019, 05:48 AM
Last Post: Skaperen
  running other older versions of python Skaperen 20 2,260 Mar-03-2018, 02:23 AM
Last Post: Skaperen
  many versions on python on linux Skaperen 8 1,435 Oct-17-2017, 02:22 AM
Last Post: Skaperen

Forum Jump:


Users browsing this thread: 1 Guest(s)