简体   繁体   中英

No module named scipy.misc

I'm trying to set up my python for some works, but I'm struggling so much! I need to use python3.4 and the scipy module.

I built the scipy module using the python3 setup.py install command from the terminal, but when I try to import the imread function from the scipy.misc module is says that

No module named scipy.misc is found.

I read that I need to install PIL or Pillow, but I already did that.

What do I have to do now?

Are you calling ./script.py ?

In many cases, a script will be hard coded to use the system's python installation, but maybe you installed scipy in a virtualenv or conda env.

So make sure the first "shebang" line in the script shows the path of the python for which you installed scipy. If it's hard coded, please consider #!/usr/bin/env python instead.

Are you calling python script.py ?

If so, then make sure which python shows the right path.

There is a distribution of Python and other tools called Anaconda which solves many of the install issues like this.
Note: After an install, restart the terminal it should set the path for you if you checked the checkbox to do that. Use pip install <package> , or conda install <package> only use python setup.py install if neither of those work, or even better yet you can use the user interface (Anaconda Navigator) to do all this without opening the terminal.

download link

Hope this helps.

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