Os:windows 10 Home Chinese version, eclipse:oxygen.1a release (4.7.1a), pydev:6.3.2
On April 25, Pydev was installed on Eclipse (recorded in the previous blog post) and a Python project was developed that did not attempt to develop the Django project;
May 2, using the downloaded Django installation package, the Django 2.0 is installed in Python 3.6.3;
May 5 (today), when you open Eclipse, the following window pops up, prompting "System PYTHONPATH changes detected"
Cause, I installed Django after installing Pydev, and I installed Django to change the python environment variable PYTHONPATH, so when you open eclipse
When it detects a change, it prompts the user to use the new Pythonpath.
Default Select all, directly click the button "Apply selected changes" can.
What's the problem if you don't change it? maybe some newly installed Python modules won't work! ( tests are required )
What is Pythonpath?
One of the search paths in the Python program import module, ranked second, consists of a number of paths.
The value of Pythonpath can be obtained through print (Sys.path) or print (Os.sys.path) .
Question: What is the difference between OS module and SYS module? Do I need import when I use it?
The Import module search order for Python:
1. Program Master Directory
Directories in 2.PYTHONPATH
Standard library directories and third-party directories (such as the Django directory mentioned in this article)
3. Any. pth file can be found?
Reference: Python module search path
My site.getsitepackages () returns the result:
4. Site-packages directory for third-party extensions
The Site-packages ( already present in Pythonpath ) under the Lib directory in the Python home directory.
Note that it is not found in the directory above, it will produce an import exception , and only the specified directory will not be searched recursively (enter
Directory below the above directory).
note that Windows first searches for "." directory, which is the current path, and linux will only be searched from the path of the environment variable (UNIX?). Linux also needs to be verified ).
Type of path:
1. Normal path
e.g. C:\\python36\\lib
2. Dictionaries
e.g.?
3.ZIP file
e.g. C:\\python36\\python36.zip
4.egg file (python egg, python eggs)
e.g. C:\\python36\\lib\\site-packages\\django-2.0.3-py3.6.egg
Description, the. Egg file, is a package created by the Setuptools library, with a ZIP file that adds metadata (version number, dependencies, and so on).
Reference Links:
Python environment variable Pythonpath settings
Python Modular Module Search order, repeat import, module load list (v)
Python Module Search Path
Python development Environment (2): Pythonpath changes detected when you start eclipse