How does python change the environment

1、 File Setting Project:xxx Project Interpreter select or add environment

2. The first method sometimes does not solve the problem, and the following problems will occur:

1、 Solution: Edit configurations PythonInterpreter to modify Project Default xxx to a certain python operating environment

Run again at this time to succeed!

Content expansion:

Switch Python operating environment under windows

1、 First make sure that Conda is installed in your system, open a command line window, and execute the command: conda -version

2、 Check the current Python environment of your system and execute the command: conda info -envs. From the figure, we can see that my machine currently only has the default Python environment created when Anaconda is installed. The environment name is root and the corresponding Python version Is 3.7

3、 Now, I want to add a Python2.7 environment, execute the command: conda create -name python27 python=2.7, in the command I set the environment name to be python27, and specify the Python version to be 2.7. After executing the command, Conda will automatically download the latest Version of Python2.7, and automatically deploy

4、 At this point, check the current Python environment of your system again, and execute the command: conda info -envs. From the figure, we can see that there is an additional Python environment named python27.

5、 Check the Python version we are currently using, execute the command: python -version, you can see from the figure that the current Python environment is version 3.7

6、 Switch the Python environment to the newly added Python2.7, execute the command: activate python27, and then execute the command: python –version, to see if the switch is successful, the careful students will find that the command I typed above is executed in git bash, but The switch command is executed in cmd. This is because I found that executing in git bash is useless. I don't know if other students will do it.

7、 In the Python27 environment, after finishing the work, switch back to the original Python environment and execute the command: deactivate python27/ activate base Both are fine

8、 If the Python27 environment you just added is no longer in use, you can delete it by executing the command: conda remove –name python27 –all

Recommended Posts

How does python change the environment
How does python improve the calculation speed
How does Python handle the json module
How does Python output integers
How does python output backslashes
How does python update packages
How does python call the key of a dictionary
How does python get input examples from the keyboard
How does python handle the program cannot be opened
How does python judge the module installation is complete
How does python perform matrix operations
How does Python list update value
How to save the python program
How does python call java classes
How does python import dependency packages
How does python enter interactive mode
How does Python generate xml files
How Python implements the timer function
How to view the python module
How does python determine prime numbers
How does python call its own function
How to learn the Python time module
How does python distinguish return and yield
Quickly understand the Python development environment Spyder
2.1 The Python Interpreter (python interpreter)
How to change the CentOS server time to Beijing time
How does Python call cmd using OS modules
How to use the round function in python
How to use the zip function in Python
How to install python in ubuntu server environment
What does the tab key in python mean
How to use the format function in python
How to enter python through the command line
How about learning python at the age of 27?
How to switch the hosts file using python
How to install the downloaded module in python
Python how to move the code collectively right
Python is short-what does the spirit cage say
How does Python store data to json files
How to practice after the python file is written
Python virtual environment: Ubuntu16.04
How to understand the introduction of packages in Python
Consolidate the Python foundation (2)
How python was invented
How to create a Python virtual environment in Ubuntu 14.04
How Python parses XML
How long does it take to learn python by myself?
How to find the area of a circle in python
Consolidate the foundation of Python (4)
Python introduction and environment installation
Consolidate the foundation of Python(7)
How to comment python code
python guess the word game
How Python converts string case
Consolidate the foundation of Python(6)
Ubuntu install the latest Python 3.
Install python environment under Linux
ubuntu sets python2.5 environment variables
Python realizes the guessing game
The difference between Python extensions
How to learn python quickly