linux에서 python 소스를 실행하다 보면 위와 같은 에러 메시지가 발생하는 경우 egg 폴더를 셋팅해주어야 한다. 해결방법은 있지만 복잡하니깐 Eclipse or PyCharm과 같은 IDE를 사용하도록하자.. 알아서 해준다!
Solution ))
From my investigations it turns out that some eggs are packaged as zip files, and are saved as such in Python's
site-packages
directory.
These zipped eggs need to be unzipped before they can be executed, so are expanded into the
PYTHON_EGG_CACHE
directory which by default is ~/.python-eggs
(located in the user's home directory). If this doesn't exist it causes problems when trying to run applications.
There are a number of fixes:
- Create a
.python-eggs
directory in the user's home directory and make it writable for the user. - Create a global directory for unzipping (eg.
/tmp/python-eggs
) and set the environment variablePYTHON_EGG_CACHE
to this directory. - Use the
-Z
switch when usingeasy_install
to unzip the package when installing.