Python 3 Startup Version Settings

Asked 2 years ago, Updated 2 years ago, 18 views

By starting python3...
 If you check the version in -V, you can see "3.5.1"
 "3.4.2"

when checking the version by running the pyfile

(I want to use subprocess.run) I want to run a py file with 3.5.1 but how can I solve it?

See below

$python3-V
  Python 3.5.1
$ sudo python3 test5.py
  sys.version_info (major=3, minor=4, micro=2, releaselevel='final', serial=0)
  3.4.2

python

2022-09-30 18:55

1 Answers

sudo has launched the python3 that the root user is aware of.

Is the Python version installed in the OS different from the Python version installed in the user environment (such as pyenv or anaconda)?
To find out which Python is running on the Python interpreter:

$python-c "import sys; print(sys.executable)"


2022-09-30 18:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.