Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
555 views
in Technique[技术] by (71.8m points)

python - 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...