2011-05-03 3 views
0

누구든지 제발 장고에서 이러한 경고를 없앨 수 있습니까?django 모듈이 이미 가져 오기 및 파이썬 계란 경고

/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/_speedups.py:3: UserWarning: Module taggit was already imported from /var/www/html/matilah/taggit/__init__.py, but /usr/lib/python2.6/site-packages/django_taggit-0.9.3-py2.6.egg is being added to sys.path 

Traceback (most recent call last): 
File "manage.py", line 11, in <module> 
    execute_manager(settings) 
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager 
    utility.execute() 
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 261, in fetch_command 
    klass = load_command_class(app_name, subcommand) 
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 67, in load_command_class 
    module = import_module('%s.management.commands.%s' % (app_name, name)) 
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
File "/usr/lib/python2.6/site-packages/haystack/__init__.py", line 154, in <module> 
    handle_registrations() 
File "/usr/lib/python2.6/site-packages/haystack/__init__.py", line 151, in handle_registrations 
    search_sites_conf = importlib.import_module(settings.HAYSTACK_SITECONF) 
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
File "/var/www/html/matilah/search_sites.py", line 2, in <module> 
    haystack.autodiscover() 
File "/usr/lib/python2.6/site-packages/haystack/__init__.py", line 106, in autodiscover 
    app_path = importlib.import_module(app).__path__ 
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
File "/var/www/html/matilah/disqus/__init__.py", line 5, in <module> 
    from django.utils import simplejson as json 
File "/usr/lib/python2.6/site-packages/django/utils/simplejson/__init__.py", line 111, in <module> 
    import simplejson 
File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/__init__.py", line 111, in <module> 

File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/decoder.py", line 7, in <module> 
File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/scanner.py", line 10, in <module> 
File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/scanner.py", line 6, in _import_c_make_scanner 
File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/_speedups.py", line 7, in <module> 
File "/usr/lib/python2.6/site-packages/simplejson-2.1.5-py2.6-linux-x86_64.egg/simplejson/_speedups.py", line 4, in __bootstrap__ 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 841, in resource_filename 
    self, resource_name 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1310, in get_resource_filename 
    self._extract_resource(manager, self._eager_to_zip(name)) 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1332, in _extract_resource 
    self.egg_name, self._parts(zip_path) 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 921, in get_cache_path 
    self.extraction_error() 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 887, 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: '/home/interworx/.python-eggs' 

The Python egg cache directory is currently set to: 

/home/interworx/.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. 

본인은 "모듈이 이미 가져온"오류가 "파이썬 EGG을 추출 할 수 없습니다"오류와 함께 할 경우 확실하지 않다.

내 WSGI에 이미 다음 줄이 있습니다. os.environ['PYTHON_EGG_CACHE'] = rel('python-eggs') 나는 확실히 작동합니다. 그렇지 않으면 WSGI가 내 앱을로드하지 않습니다. 그래서 여기서 무엇을해야할지 모르겠습니다.

감사합니다.

답변

2

"아마도이 계정에이 디렉토리에 대한 쓰기 권한이 없습니까?"와 같은 메시지가 표시됩니다. 빠른 테스트를하는 것이 가장 좋습니다. "/ tmp"(모든 사람이 쓸 수 있음)로 변경하고 작업이 시작되는지 확인하십시오. 문제가 해결되면 더 적절한 디렉토리를 찾아서 (또는 서버)에 쓰기 권한이 있는지 확인하십시오.

업데이트 : 먼저 가장 빠른 오류 메시지를 해결하는 것이 맞습니다. 다음은 몇 년 전에 잘못 포함 된 모듈 오류를 추적하기 위해 작성한 빠른 유틸리티 인 Python Module Dump입니다. 초기화 코드 경로의 흥미로운 지점에이 코드를 삽입하고 이전 가져 오기가 발생한 시점을 확인할 수 있습니다.

+0

답장을 보내 주셔서 감사합니다. 네, 권한에 대해 이해합니다. 내가 혼란스러워하는 점은 그 PYTHON_EGG 디렉토리를 .wsgi 파일에서 수행 한'os.environ [ 'PYTHON_EGG_CACHE'] = rel ('python-eggs')'디렉토리로 변경했다는 것입니다. 이것은'/ my/project/path/python-egg'로 이어집니다. 확실히이 권한은 쓰기 권한을 가지고 있습니다. 그래서 내 질문은'/ home/interworx/.python-eggs'에 압축을 풀려고하는 이유일까요? – rabbid

+0

죄송합니다. 첫 번째 줄이 너무 길어서 오른쪽의 화면 너비가 약 3 화면이었습니다. –

+0

그래, 알아. 내 잘못 ! :) 어떤 아이디어? – rabbid

0

"모듈을 이미 가져 왔습니다."라는 초기 문제는 실제로 사용 권한 오류와 관련이 있습니다. 가장 좋은 방법은 /home/interworx/.python-eggs 디렉토리의 권한/소유권 설정을 수정하는 것입니다 (위의 Peter Rowell이 말한대로).

저는 Google Code University에서 오늘 사용 권한에 대해이 멋진 재능을 보았습니다. 당신은 약간의 시간이있을 때이를 통해 탈지 다치게하지 않을까요 : http://code.google.com/edu/tools101/linux/ownership_permissions.html

그냥 여기에 위의 의견을 읽고 나의 생각이다

나는 문제가 .wsgi 파일에서 환경 변수를 설정하지 않는 것을 생각 시각. .wsgi 파일을 게시 할 수 있습니까? 또한, 어떻게 패키지를 잡는거야? 그게 대본 이니? 핍을 통해 수동으로?

+0

답장을 보내 주셔서 감사합니다! 권한에 대한 Peter의 대답에 대한 내 의견을 참조하십시오. 고맙습니다! – rabbid

관련 문제