简体   繁体   中英

ModuleNotFoundError: No module named 'tensorflow_datasets'. How to solve this?

I'm new to Python and am usually running Spyder or VS Code. I am running a script right now that gives me the error: ModuleNotFoundError: No module named 'tensorflow_datasets'.

I can see on my pip list that I have tensorflow ver. 2.4.0 and tensorflow_datasets ver. 4.2.0. The location of tensorflow is:

Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages

And the location of tensorflow_datasets is:

Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages

Maybe it has something to do with the location/directory? Since I am using Spyder and VS Code through Anaconda.

I am running macOS Big Sur 11.1

Are you using IDE or Jupyter?

IDE:

Choose Anacondna as your default environment, Mac is running on Python 2 by default.

Jupyter: Kernel>Change Kernel

Pycharm: Bottom right

VS Code: Bottom left

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM