[help] Pip and different versions of Python

Hey folks! I run Mint 18.3 and I have both Pyhon3.5 and Python3.6 since many devs got crazy with fstring syntactic sugar.
How to deal with Pip module management? The 3.5 version (which is python3) is fine and can import everything as usual, but the 3.6 version (which is python3.6) cannot.
Suggestions?

EDIT: thanks all ^^
I ended up using:
$> python3.6 -m pip install {module I need}

Arden
link
61Y

I’ve always used python3 -m venv so perhaps you can use

python3.6 -m venv newenvironemt
. ./newenvironment/bin/activate
pip3.6 install package

To install a virtualenv tied to a specific python version?

@Giffen
link
51Y

You probably want to run pyenv + one of [poetry, pipenv, pip-tools]. See “Overview of python dependency management tools”.

@DelishVeg
link
21Y

have you tried an environment management tool like pew or pipenv?

@diorama
creator
link
11Y

Do you find OK I re-installed the modules I have already had via pip again?

@wraptile
banned
link
11Y

Wait, mint is still stuck on py3.5? Maybe it’s time to consider a distro switch…

@diorama
creator
link
11Y

Idk, I have an older version.

@wraptile
banned
link
11Y

Generally every python3 app these days requires py3.6.1+ because this version has some major changes. You should really upgrade.

You should probably never upgrade your system version of python, as the OS might be dependant on it. If I need a newer python version than my OS supports out of the box, I’ll first check the official repos to see if a newer version is available, and otherwise I’ll compile from source, which really isn’t that difficult.

@diorama
creator
link
1
edit-2
1Y

I’ll do so at some point. I am conservative in system updates.
What was the driving force pushing forward from 3.5.x to 3.6.1+? Is it just syntactic sugar?

@wraptile
banned
link
11Y

There are major syntax updates for asynchronous programming, f-strings and few other minor but useful things like pathlib.Path objects which are often used in desktop apps and CLIs.

@diorama
creator
link
11Y

Thanks to clarify!
I am too noob to assess how many programs could critically benefit from these advancements. The programs I have encounter until now - a niche of a niche of the scientific community - break the backwards compatibility just for fstrings. Also, I am not confident with interfaces and more on the back-end side. That is why my experience is biased against syntactic sugar.
I am glad people find useful these brand-new features and open to learn them. :hugging face:

@wraptile
banned
link
21Y

Cheers, 3.6 was a really good release! Releases like this are somewhat rare in programming languages so confusion is understandable :)

@ksynwa
link
11Y

Try this: https://stackoverflow.com/a/4910393

On Void Linux, pip packages are installed to ~/.local/lib/python3.8/site-packages and /usr/lib/python3.8/site-packages. On Mint I suppose it should be the same or at least similar so that’s how pip packages are separted by version number.

News and discussions about the programming language Python


  • 0 user online
  • 1 user / day
  • 1 user / week
  • 7 user / month
  • 12 user / 6 month
  • 1.03K subscriber
  • 124 Post
  • 64 Comment
  • Modlog