-
Notifications
You must be signed in to change notification settings - Fork 87
ImportError: No module named decorator #35
Comments
Can you try to install the I think it's because we did not install the dependency of the |
I never got a notice on this so I didn't know you even responded. I actually came back to report this again because I forgot I had brought it up! If I manually specify decorator, it looks like it does install and run with 0.12.6. A problem here is that I am using it in my own package, and I have to put it in my own package and hope it gets fetched first. I think the problem is that setup.py is trying to fetch version information from inside pinject, which has an init.py that will try to import decorators. If you can split that off then I imagine it would stop cropping up. |
The main problem here is if I make pinject a dependency for another Python package, pip will run setup.py and fail to find decorator--even if I specify decorator as a dependency in my own package--because pip hasn't actually installed it yet. |
Previously, setup.py would import the version information from pinject.version. This would trigger pinject's __init__.py to import and load, which would take a roundabout path to importing the decorator dependency. The setup.py script is launched by pip while inspecting the package and dependencies, so this problem will come up in a package sourcing pinject as a dependency even if decorator is declared as a dependency in that package. Referencing: https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-version The previous method was similar to number 6 (setting the value of __version__ and then importing it). It was changed to number 4 (placing the version in a VERSION file that is read from disk). Given there is a parent VERSION file that is connected to the Makefile, this file is now sourced by setup.py. To ensure it is available when installing pinject, the VERSION file was also added to the manifest. The existing version.py convention is kept for regular use by pinject since that file is readily available to the package when running its source normally. This should fix issue google#35.
I noticed this in the most-recent PyPI releases (0.12.2, 0.12.6):
Win10 with 64-bit Python 2.7.15, pip 10.0.1, pinject 0.12.6:
The same line fails with the same error on Ubuntu 16 using 64-bit Python 2.7.15rc1, pip version 9.0.1, trying to download 0.12.2.
I download the module to convert it to a distribution-specific package for internal distribution. The pip download command itself is failing.
Version 0.10.2 downloads fine and I've updated my software's setup.py to be bound to it instead of trying to acquire the newer versions.
The text was updated successfully, but these errors were encountered: