Why doesn't my Python 2.6 auto-unzip egg files on import? -
I am under the assumption that python imports should automatically open egg files in site-packages.
My installation does not seem to unzip the egg automatically. What I tried:
(1) I used easy_install to install the suds module, Copy the egg file into the package. Python could not import it. (Import suds)
(2) Then I used the always-unzip option - to easy_install. This time he gave me a directory instead of a zip file. Python could still not import Sud Module.
(3) I changed the name of the directory revenge. Still could not find it.
(4) Finally, I copied the directory of the eggs from the open eggs directory to python and python (no wonder).
For me, there was not easy_install. What is missing here?
Rufus
By default (if you have not specified multi-version Mode), easy-setting one egg will add an entry to the Are you trying to Python will import from ZIP archives, but this site will not unzip the archive in the package, that is, it will not leave unzipped directories after you import it. (I think that this file reads it in the file file without extracting it anywhere in the file system.) I have seen those problems where some packages do not work as zipper eggs (they try to read data from their location in the file Key system), so I always recommend using a different-unzip flag while doing (2). You have not given the command lines used. Have you specified the easy_install -m option? This will install eggs in multi-version mode. It will not be in sys.path by default, and you must use the easy-to-install.pth file in the site-package. Check to see if there is any reference to the sud egg. You can also check the Python Import Path (which is a list of places Python will search for modules):
import sys.path
import suds in a Python shell which was started before you easy_installed the SUS? This will be understood by the behavior you have seen. Files are read only on Python startup, so the under directory or zip file does not appear in
sys.path . Copying
suds dir from inside the under directory because
site-package was already in
sys.path . So make sure you restart the python after installing the python.
pkg_resources.require function before importing it.
Comments
Post a Comment