Found after installation Python3, unable to run, as shown in the figure below, what reason be excuse me? How to solve?
Thank you first!
CodePudding user response:
Tribon built-in python, two python version at the same time there is only one effective, but also may conflict,There is only one way,
CodePudding user response:
What way? Please expressCodePudding user response:
1. Delete the original including python3 any system environment variables, why you have so many python environment variable2. Keep the following code for python3. Bat and excluding python related documents on the arbitrary folder
3. Add the path variable system environment for the above folder
The first sentence must get the method of use: the console input python3 instead of python
Such as input: python3 or python3 test. Py and so on after an arbitrary command is python3 environment
Can replace with python python3 after, of course, also can continue to use python3,
Can operate in its usual way: PIP install SomePackage installation package, of course you can also
The first sentence using: python3 PIP install SomePackage
@ echo off
Set the path=c: \ python3; C: \ python3 \ Scripts. % ~ dp0
Python % 1% 2% 3% 4% 5% 6% 7% 8% 9
CodePudding user response:
update code, forget to % ~ dp0; Added after the original path environment variableYour path variable to add original to remove contains m3 item (i.e. the Tribon path environment variable)
@ echo off
Set the path=c: \ python3; C: \ python3 \ Scripts. % ~ dp0; C: \ Windows \ system32; C: \ Windows; C: \ Windows \ System32 \ Wbem; C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Windows \ System32 \ OpenSSH \; C: \ Users \ lee \ AppData \ Local \ Microsoft \ WindowsApps
Python % 1% 2% 3% 4% 5% 6% 7% 8% 9
CodePudding user response:
My m3 variables in the system PYTHONPATH inside, see below:Please change the PATH or PYTHONPATH?
Thank you very much!
CodePudding user response:
Is if C:/Python3 your Python3 installation directory, only contains C:/Python3, delete all, including the user in the path variable, the following system and in the path variable PYTHONPATH variable, then update code:@ echo off
The set PYTHONPATH=
Set the path=c: \ python3; C: \ python3 \ Scripts. C: \ python3 \ Dlls. C: \ python3 \ lib. % ~ dp0; C: \ Windows \ system32; C: \ Windows; C: \ Windows \ System32 \ Wbem; C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Windows \ System32 \ OpenSSH \; C: \ Users \ lee \ AppData \ Local \ Microsoft \ WindowsApps
Python % 1% 2% 3% 4% 5% 6% 7% 8% 9
CodePudding user response:
Is equivalent to remove Python3 variables in your computer, remove the Tribon variables in the code I gave you,CodePudding user response:
% ~ dp0Python % 1% 2% 3% 4% 5% 6% 7% 8% 9
What those words mean?
CodePudding user response:
% ~ dp0Represents the current batch file python3. Bat is a complete directory
Python % 1% 2% 3% 4% 5% 6% 7% 8% 9
Will all pass python3. The parameters of the bat to python. Exe
So python3. Bat the Tribon environment variables are eliminated, set up a new environment variable, and pass parameters to the Python implementation,
CodePudding user response:
The