Solve the problem that eclipse prompts that the package cannot be found ModuleNotFoundError when importing after the command line pip installs the package

The reason is very simple, it is the pydevmiddle pythonpathproblem of eclipse,

Take the problem I encountered as an example. I want to use the third-party module SQLAlchemy in eclipse,
but import SQLAlchemythe 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 librariesinto

The operation steps are as follows:

insert image description here
insert image description hereWill
Paste the address found in the second step to the position in the above picture, and then click the 'Select Folder' button.

insert image description here
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.

insert image description hereAs 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 namedof .

the 02nd December 2022 Friday

Guess you like

Origin blog.csdn.net/m0_47505062/article/details/128148765