If you enter pip list
in the cmd window, or enter conda list
in the terminal window of vscode, or enter conda list
.You will find, hey, doesn't this have sklearn and pandas?Why is the error No module named 'sklearn'
, No module named 'pandas'
reported when running the code in pycharm and vscode, in fact, this is saying that these twoA package that does exist on your computer, but not in the environment where TF2.1 was created.
Click on the computer "Start"->Anaconda3->Anaconda Navigator->Environments->TF2.1 right triangle button->open Terminal, at this time enter the created TF2.1 environment terminal.
Enter conda list
and you will find that there are no sklearn and pandas packages in this environment.
Enter activate TF2.1
to activate this environment.
Enter the download link of Douban source python -m pip install pandas -i https://pypi.douban.com/simple
, you can download pandas
You can also download the sklearn package.
Note that this library will indeed be installed by entering pip install sklearn
directly in the terminal window of vscode and the Terminal window of pycharm, but it is not installed in the TF2.1 environment.If you don't believe me, you can go to "Start"->Anaconda3->Anaconda Navigator->Environments->Triangle button on the right side of TF2.1->open Terminal
This real TF2.1 terminal input condalist
, you will find that the installed library cannot be found.
I came across this article while looking for a solution to the problem, and I posted the original link so you can take a look.
Could not find conda environment: tensorflow | anaconda activation environment