我在Mac上导入(显然是安装) Cherrypy时遇到了问题。我使用了'pip',setup.py的python install,它可以工作(我还检查了Python文件夹中的cherrypy文件夹),但是当我尝试导入cherrypy时,它不工作:
ImportError: No module named 'cherrypy'是否有人遇到了同样的问题并找到了解决方案?
谢谢。
在T。
发布于 2014-07-11 14:23:14
昨天我也遇到了同样的问题。我在使用pip时,出现了导入错误和其他错误。因此,我卸载了cherrypy (sudo pip uninstall cherrypy),然后使用了sudo easy_install cherrypy。它对我起作用了!
发布于 2015-04-23 09:35:54
只需使用
sudo easy_install cherrypy发布于 2017-12-17 16:50:35
如果您使用sudo easy_install cherrypy,请确保只有一个版本的python。在macOs上,默认情况下会安装python版本2.7。但是如果你有像我一样的两个版本的cherrypy,你必须确定要使用哪个easy_install来安装python。我的mac上有python 3.6,也有python 2.7,如果你想在3.6 python上安装cherrypy。
easy_install,结果如下:/usr/bin/easy_install /usr/bin/easy_install-2.7 /usr/local/bin/easy_install-3.6
现在,您知道了要使用哪个easy_install应用程序来安装基于python版本的cherypy。
cherrypy,请在终端上输入$ sudo easy_install-3.6 cherrypy
如果想要在2.7Python上安装cherrypy,只需输入
`$ sudo easy_install cherrypy`它将根据我们想要的版本进行安装
希望对您有所帮助:)
https://stackoverflow.com/questions/24597598
复制相似问题