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

Declaring brewer2mpl as an install_requires installs it as an egg, breaking it. #6

Closed
anntzer opened this issue Sep 18, 2014 · 5 comments

Comments

@anntzer
Copy link

anntzer commented Sep 18, 2014

After declaring brewer2mpl as a dependency in a setuptools setup.py, brewer2mpl is installed as an egg (zip), so importing it breaks as it cannot open _DATAFILE.

$ python -c 'import brewer2mpl'   
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "/path/to/virtualenv/lib/python3.4/site-packages/brewer2mpl-1.4-py3.4.egg/brewer2mpl/__init__.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "/path/to/virtualenv/lib/python3.4/site-packages/brewer2mpl-1.4-py3.4.egg/brewer2mpl/brewer2mpl.py", line 21, in <module>
NotADirectoryError: [Errno 20] Not a directory: '/path/to/virtualenv/lib/python3.4/site-packages/brewer2mpl-1.4-py3.4.egg/brewer2mpl/data/colorbrewer_all_schemes.json'
@jiffyclub
Copy link
Owner

I think this should be fixed by 47f57eb. I've released version 1.4.1 with the fix. Please give it a try and let me know if it works for you. Thanks for the report!

@anntzer
Copy link
Author

anntzer commented Sep 19, 2014

It is still not possible to install brewer2mpl via install_requires, this time because the import of ez_setup fails (probably due to the value of the search path when setuptools actually runs setup.py). I guess the top of setup.py should just read

try:
    import setuptools
except ImportError:
    import ez_setup; ez_setup.use_setuptools()
    import setuptools

@jiffyclub
Copy link
Owner

Got another fix in with 58cefe3. I've updated the release files, please try again.

@anntzer
Copy link
Author

anntzer commented Sep 19, 2014

That works now, thanks for the quick reply.

@jiffyclub
Copy link
Owner

Awesome, thanks for helping me get things fixed up!

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

No branches or pull requests

2 participants