Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

'pip install -r requirements.txt -t lib' does not work for namespaced packages #8

Closed
webmaven opened this issue Jul 16, 2014 · 9 comments

Comments

@webmaven
Copy link
Contributor

It seems that pip installing namespace packages (examples: repoze.lru, zope.events, zope.interface, etc.) into a local directory like lib/ does not work. Or rather, the packages are installed correctly, but Python ignores the *-nspkg.pth file when packages are not in the usual locations: pypa/pip#1924

Right now, the skeleton inserts lib/ into sys.path to make dependencies importable in the first place: https://github.com/GoogleCloudPlatform/appengine-python-flask-skeleton/blob/master/appengine_config.py#L6

Is there anything similar that can be done to get namespace packages working correctly?

@webmaven
Copy link
Contributor Author

Looks like replacing the sys.path.insert() call with site.addsitedir() is the right solution. Would a PR be accepted?

@proppy
Copy link
Contributor

proppy commented Jul 23, 2014

@webmaven, sure as long as you follow CONTRIB.md and document which version of pip is required in README.md.

@webmaven
Copy link
Contributor Author

Thanks!

UPDATE: The version of pip required has not changed.

@webmaven
Copy link
Contributor Author

BTW, I've submitted the individual CLA.

@lesv
Copy link
Contributor

lesv commented Aug 14, 2014

I'm reviewing this now. Sorry for the delay.

@webmaven
Copy link
Contributor Author

@lesv, thanks for merging the PR! Should I close this issue now, and get started on similar issues/PR's for other affected example apps?

@lesv
Copy link
Contributor

lesv commented Aug 14, 2014

I have no idea how proppy manages things, so I'm going to close the issue. Just send pull requests, and for the next week, just mention lesv in the comments, so I know to look at them. I don't think you need to open an issue for each problem if your going to submit PR's.

@lesv lesv closed this as completed Aug 14, 2014
@lesv
Copy link
Contributor

lesv commented Aug 14, 2014

P.S. Thank you for your submission.

@webmaven
Copy link
Contributor Author

Cool, thanks for the guidance.

P.P.S. You're very welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants