Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError when installing package from github #26

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

didoarellano
Copy link
Contributor

Importing django in setup.py to grab the version string blows up when installing this package from github and django isn't installed yet.

Steps to reproduce

git clone https://github.com/didoarellano/fluffy-barnacle.git`
cd fluffy-barnacle
mkvirtualenv -p /usr/bin/python3.6 fluffy-barnacle
pip install -r requirements.txt

Result:

2018-09-21-17 31 21

The fix

It's likely not the right way to do it but I moved the version string from hashid_field/__init__.py to setup.py so that django is no longer needed just to get the version. If there's a correct way of fixing this just point me in the right direction.

Installing from the "fixed" branch succeeds:
pip install -r fixed_requirements.txt

@nshafer nshafer merged commit 82615c3 into nshafer:master Sep 21, 2018
@nshafer
Copy link
Owner

nshafer commented Sep 21, 2018

Thanks for the patch. So I found this page describing different methods to fix this issue. Then I looked at how some different modules do it, and decided to copy the method from django-rest-framework as I'm sure they have tested it extensively. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants