Python程序启动时报错:
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
Traceback (most recent call last):
File "launchy_wsgi.py", line 12, in <module>
application = launchy.Application(gac.list(), uimodules)
File "*****************", line 48, in list
*********************************
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1184, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s)
to the Python egg cache:
[Errno 13] Permission denied: '/root/.cache/Python-Eggs'
The Python egg cache directory is currently set to:
/root/.cache/Python-Eggs
Perhaps your account does not have write access to this directory?
You can change the cache directory by setting the PYTHON_EGG_CACHE
environment variable to point to an accessible directory.
解决方法:到你的Python目录中的
site-packages,查看有没有*.egg文件,我的是pycurl-7.43.0.1-py2.7-linux-x86_64.egg 。
然后新建相同名称的目录,将文件内容解压进去,重启成功!示例如下:
cd /usr/local/lib/python2.7/site-packages/
ll pycurl-7.43.0.1-py2.7-linux-x86_64.egg
mv pycurl-7.43.0.1-py2.7-linux-x86_64.egg foo.zip
mkdir pycurl-7.43.0.1-py2.7-linux-x86_64.egg
cd pycurl-7.43.0.1-py2.7-linux-x86_64.egg/
unzip ../foo.zip
rm ../foo.zip