jiffyclub/palettable

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

Closed this issue · 5 comments

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'

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!

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

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

That works now, thanks for the quick reply.

Awesome, thanks for helping me get things fixed up!