This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Bug with reimport in pkg_resources
Type: resource usage Stage:
Components: Library (Lib) Versions: Python 2.6, Python 2.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, Сергей.Чупраков
Priority: normal Keywords:

Created on 2011-02-01 17:41 by Сергей.Чупраков, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg127704 - (view) Author: Сергей Чупраков (Сергей.Чупраков) Date: 2011-02-01 17:41
import pkg_resources change path of already imported module
this break google appengine because It use "google.__file__" to determine sdk directory.

Ubuntu 10.10
~/lib/google_appengine$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from appcfg import fix_sys_path
>>> fix_sys_path()
>>> import google
>>> google
<module 'google' from '/home/schuprakov/lib/google_appengine/google/__init__.pyc'>
>>> import pkg_resources
>>> google
<module 'google' from '/usr/lib/pymodules/python2.6/google/__init__.pyc'>

ls /usr/lib/pymodules/python2.6/google/  __init__.pyc  protobuf
msg127707 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-01 20:41
pkg_resources is not from Python but setuptools; you probably installed it and forgot it was there. I would suggest you do your App Engine development using virtualenv to make sure that you are working in a clean environment.
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55300
2011-02-01 20:41:19brett.cannonsetstatus: open -> closed

nosy: + brett.cannon
messages: + msg127707

resolution: not a bug
2011-02-01 17:42:05Сергей.Чупраковsetcomponents: + Library (Lib)
2011-02-01 17:41:52Сергей.Чупраковsetcomponents: - Build
2011-02-01 17:41:36Сергей.Чупраковsetcomponents: + Build
versions: + Python 2.6, Python 2.5
2011-02-01 17:41:06Сергей.Чупраковcreate