我已经能够 pip 安装所有其他包,例如 bumpy、sklearn 等,但是 mnist 包会抛出如下错误。我一直在尝试使用 sudo pip install 但它也说
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)
原文由 jen007 发布,翻译遵循 CC BY-SA 4.0 许可协议
请注意
python-mnist
和mnist
是两个不同的包,它们都有一个名为mnist
的模块。你想要的包是python-mnist
。所以这样做:可能需要卸载
mnist
包:那么您的导入语句应该可以工作。