The reason is very simple, it is the pydev
middle pythonpath
problem of eclipse,
Take the problem I encountered as an example. I want to use the third-party module SQLAlchemy in eclipse,
but import SQLAlchemy
the error is reported.
import SQLAlchemy
ModuleNotFoundError: No module named 'SQLAlchemy '
Solution:
1. Go to the command line window again to execute the installation command,
pip install SQLAlchemy
2. Find and record the path
Requirement already satisfied:
followed by
Mine is: c:\users\handsome\site-packages
, as follows:
pip install SQLAlchemy
Requirement already satisfied:
SQLAlchemy in c:\users\handsome\site-packages
3. Paste it
libraries
into
The operation steps are as follows:
Paste the address found in the second step to the position in the above picture, and then click the 'Select Folder' button.
Then, eclipse will perform an update operation, and finally, eclipse will be able to recognize the various packages we installed using the command pip in the command line window.
As can be seen from the figure above, the libraries we just operated are actually setting the 'pythonpath' of eclipse.
Therefore, if the pythonpath is solved, the problem ModuleNotFoundError: No module named
of .
the 02nd December 2022 Friday