I've able to pip install all other packages such as bumpy, sklearn etc. but mnist package throws me error as the following. I've been trying to use sudo pip install but it also says that
applesys$ pip install mnist
Requirement already satisfied: mnist in /Users/applesys/anaconda3/lib/python3.5/site-packages
Requirement already satisfied: numpy in /Users/applesys/anaconda3/lib/python3.5/site-packages (from mnist)
applesys$ sudo pip install mnist
Password:
The directory '/Users/applesys/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/applesys/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: mnist in /Users/applesys/anaconda3/lib/python3.5/site-packages
Requirement already satisfied: numpy in /Users/applesys/anaconda3/lib/python3.5/site-packages (from mnist)
Note that python-mnist
and mnist
are two different packages, and they both have a module called mnist
. The package you want is python-mnist
. So do this:
pip install python-mnist
It might be necessary to uninstall the mnist
package with:
pip uninstall mnist
Then your import statement should work.
As noted by @dinosaur, python-mnist and mnist are two different packages. For python package, python-mnist, the only module is loader.
If you change the import to:
from mnist.loader import MNIST
It should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With