이 블로그 검색

2015년 6월 22일 월요일

[ Python / Ubuntu] ubuntu에서 python 실행시 PYTHON_EGG_CACHE 에러

/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/mataeoh/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable)

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:
  1. Create a .python-eggs directory in the user's home directory and make it writable for the user.
  2. Create a global directory for unzipping (eg. /tmp/python-eggs) and set the environment variable PYTHON_EGG_CACHE to this directory.
  3. Use the -Z switch when using easy_install to unzip the package when installing.

댓글 없음:

댓글 쓰기