Python Forum
Python directory structure in wqin 11
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python directory structure in wqin 11
#1
I just downloaded python 3.12

In my computer if I go to cmd line>py I get to python3.12
if I go to cmdline>python I get to python3.8
Why is this?

Will my python 3.8 programs run under 3.12?
Am I going to have issues with the include files being in new places?

Note: On my windows computer, Python3.12 is at users/hamil/appdata/l;ocal/programs/python312
but python 3.8 is at program filkes(8y6) python38-32>python,exe

I would like to clean up my computer, get rtid of unused versions, and start usiong a modern editor perhaps like vbcode???

Advice woujld be helpful
Reply
#2
When you type "python" in the cmd shell it looks for python.exe using the PATH environment variable. When you run python using py, it uses the python launcher for windows which pics the most appropriate version of python. In most cases this is the latest version of python installed on your computer, but if you launch python by double clicking on a .py file, it will use the python specified in the file shebang (if there is one).
Reply
#3
Some info on how this work.
Environment Variables Path do changes here to Python 3.12 path.
As shown in this image image
You add this.
Output:
C:/users/hamil/appdata/l;ocal/programs/python312 C:/users/hamil/appdata/l;ocal/programs/python312/Scripts
Then test in cmd python -V and pip -V,should now point to 3.12.

barryjo Wrote:In my computer if I go to cmd line>py I get to python3.12
This is because when you install Python it place py.exe in C:\Windows folder.
Then it works as this folder is always in Environment Variables Path.
Reply
#4
Quote:Will my python 3.8 programs run under 3.12?
They are very likely to run without any issues, though it is possible that you used some features of python that were depreciated. If you are using depreciated features your programs will probably still run, but will generate warning messages that they may stop running in the future.

Quote:Am I going to have issues with the include files being in new places?
Do you mean the "import" files? If you install a package using pip, python will find it. If you run python 3.8 it will look in the site packages for 3.8.
If you run python 3.12 it will look in the site packages for 3.12. If you have a virtual environment, it will look in the site packages for the virtual environment. If you have multiple pythons, you'll need to install the package in the python you are using. Installing a package in 3.8 does not install the package for any other python on your computer, including virtual environments that use python 3.8.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Project Structure for Modularity and Reusability with Multiple Entry Points b19wh33l5 0 1,274 Apr-24-2024, 12:21 PM
Last Post: b19wh33l5
  python project structure anne 1 2,334 Aug-01-2020, 07:17 PM
Last Post: deanhystad
  Create a directory structure across many servers metro17 1 2,261 Nov-05-2019, 03:35 PM
Last Post: Larz60+
  Call functions recursively in tree structure using python dubru 1 2,873 Feb-15-2019, 06:43 PM
Last Post: nilamo
  auto-py-to-exe with unusual directory structure krow4869 3 6,901 Nov-26-2018, 03:48 PM
Last Post: random_nick
  Python structure question PickyBiker 4 5,956 Dec-11-2016, 05:37 PM
Last Post: PickyBiker

Forum Jump:

User Panel Messages

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