gpt4 book ai didi

python - 导入错误 : cannot import name 'MNIST'

转载 作者:太空狗 更新时间:2023-10-30 00:24:51 28 4
gpt4 key购买 nike

我已经能够 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)

import error

最佳答案

请注意 python-mnistmnist是两个不同的包,它们都有一个名为 mnist 的模块。您需要的包是 python-mnist。所以这样做:

pip install python-mnist

可能需要卸载 mnist 包:

pip uninstall mnist

那么你的 import 语句应该可以工作了。

关于python - 导入错误 : cannot import name 'MNIST' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42755078/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com