Python Forum
Virtual environment and upgrading python 3.5 to 3.9
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Virtual environment and upgrading python 3.5 to 3.9
#1
I have python 3.5.2 with a single virtual environment on linux mint 18, which also has a system 2.7.12. I have installed a number of packages using pip from the VE, and it all seems to work fine. That was a while ago, I've forgotten how I did it other than it seemed quite stressful, and my notes from the time are obviously about a new python3 installation, not a second one.

I now want to go up to something higher than 3.5 (for some specific packages, and f strings look useful). 3.9 is now available in the standard repo, so I might as well go to the latest. I'm not a developer, just a hobbyist, there's no need for me to keep 3.5 going once 3.9 is working.

I've being trying to find out how to do it, and the documentation online doesn't address what I thought was my specific problem, of making a new VE and putting 3.9 in it, to keep things separate from 2.7 and 3.5. After a week of puzzling, I'm now beginning to think my original conception was wrong. I thought that the VEs isolated different versions of python and their packages from each other. I'm starting to think that they isolate the packages alone.

If my new conception is correct, then I should simply apt-get install python3.9. I'm reluctant to simply do this as I don't want to break my main machine.

Does the installation of 3.9 make the python3 command use 3.9 instead of 3.5? or
Do I need to make a new VE once 3.9 is installed? and
If so, how does it get pointed at 3.9?

This is one of those things that's presumably so obvious that it's not documented in a way I can understand. While I'm quite capable of writing quite complex programs once 'hello world' is working, I'm totally capable of messing up the programming environment so that I can't even run that. I notice various files in the bin of my VE have file names like xx2.7, xx3 and xx3.5, which suggests it does get 'pointed at' the relevant python version at some stage during installation.
Reply


Messages In This Thread
Virtual environment and upgrading python 3.5 to 3.9 - by NeilUK - Jan-22-2021, 05:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python use of virtual environments bre67e49 4 706 Feb-19-2025, 04:01 AM
Last Post: Sece1967
  I cannot create a virtual environment on visual studio code using python Willem_Aucamp316 2 2,855 Nov-27-2024, 02:20 PM
Last Post: menator01
  How to enable Matplotlib within virtual environment? tetris_theMovie 1 1,057 Oct-11-2024, 09:56 AM
Last Post: christie2
  Need help setting up trusted root ca in virtual environment dstempfley 0 1,187 May-31-2024, 03:14 PM
Last Post: dstempfley
  Help with creating folder and "virtual environment" AudunNilsen 1 985 Mar-21-2024, 04:41 AM
Last Post: deanhystad
  Best practice on using virtual environments in Python bytecrunch 6 13,266 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Virtual Env changing mysql connection string in python Fredesetes 0 954 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  Installing python packages in a virtual environment Led_Zeppelin 1 1,590 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 4,564 May-10-2023, 02:13 PM
Last Post: Calab
  Python development environment standenman 3 3,323 May-04-2023, 07:24 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020