pip install autoPyTorch失败
在使用命令“pip install autoPyTorch”进行安装时候,报错如下图1所示:
问题不知道出在哪里。具体看报错的细节说我“opt/anaconda3/bin/cmake", line 5, in
from cmake import cmake
ModuleNotFoundError: No module named ‘cmake’”,但是我已经使用“pip install cmake”安装成功,并且使用“from cmake import cmake”验证过确定安装成功。
Mac系统,在jupyter中运行的。
很奇怪,百思不得其解,网上也搜索不到答案。
尝试1:将cmake卸载重新安装一遍,没有用,仍然报这个错。
尝试2:先运行“pip install catboost”,仍然出现同样的错误。
尝试3:找到文件路径“opt/anaconda3/bin/cmake”中发现有cmake这个可执行文件。
尝试4:在命令行中运行’pip3 install cmake’,等一会就安装成功。无效。
尝试5:pip install --upgrade setuptools、pip install dlib==19.17.0。运行这2个命令。【参见:https://github.com/davisking/dlib/issues/1872】。无效。
尝试6:下载官网【https://pypi.org/project/autoPyTorch/】的tar文件或者whl文件,本地解压缩,然后再本地安装。无效。
尝试6:命令行中使用conda install catboost、conda install autoPyTorch。报错。
尝试7:jupyter中使用conda install autoPyTorch。报错。
尝试8:在catboost官网上【https://catboost.ai/en/docs/concepts/python-installation】查看如何下载。第一种方法pip install catboost,在命令行中运行仍然报同样的错误。第二种方法conda install catboost,在命令行中没有用。
尝试9:使用文章中的方法https://blog.youkuaiyun.com/qq_54827663/article/details/128564759。报错,可能是下载的版本太新(19.24),从https://pypi.tuna.tsinghua.edu.cn/simple/dlib/下载旧版本19.13.0。
尝试10:使用文章中的方法https://github.com/davisking/dlib/issues/1872。
具体如下:
Solved it by :
Downloading the dlib files from here: https://pypi.org/project/dlib/#files
Extracting the files and copying them to C:\Users{Replace by yourUserName}\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
Openning the terminal and changing to the previous directory ; cd C:\Users{Replace by yourUserName}\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
running the following command python setup.py install --no DLIB_GIF_SUPPORT
Hope it helps
问题在于安装好了dlib没有用。
尝试10:在命令行运动“pip3 install catboost”成功!但是没有用。
尝试11:仍然自己先在官网下载whl文件【https://pypi.org/project/catboost/#files】【catboost-1.2-cp39-cp39-macosx_11_0_universal2.whl】,然而在命令行中报错“ERROR: catboost-1.2-cp39-cp39-macosx_11_0_universal2.whl is not a supported wheel on this platform.”,搜索得到https://blog.youkuaiyun.com/qq_44832009/article/details/129351554可知版本不匹配。接着在命令行中输入“pip debug --verbose”,查看可以使用的版本,我这里直接把文件名修改为“catboost-1.2-cp39-cp39-macosx_10_16_universal2.whl”,接着运行【pip install “/Users/(这里是你的用户名)/Downloads/catboost-1.2-cp39-cp39-macosx_10_16_universal2.whl”】就大功告成!