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

PY27 bcolz with dask unicode error #322

Closed
alimanfoo opened this issue Oct 12, 2016 · 7 comments
Closed

PY27 bcolz with dask unicode error #322

alimanfoo opened this issue Oct 12, 2016 · 7 comments

Comments

@alimanfoo
Copy link
Contributor

With dask and bcolz installed into PY27 via pip I get:

Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bcolz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/aliman/src/github/cggh/scikit-allel/.tox/py27/local/lib/python2.7/site-packages/bcolz/__init__.py", line 51, in <module>
    if dask.__version__ >= LooseVersion(min_dask_version):
  File "/usr/lib/python2.7/distutils/version.py", line 296, in __cmp__
    return cmp(self.version, other.version)
AttributeError: 'unicode' object has no attribute 'version'
@mtrbean
Copy link

mtrbean commented Oct 14, 2016

I'm getting the same error...

@FrancescAlted
Copy link
Member

That's curious because TravisCI is not complaining about this (perhaps because it uses conda packages?).. At any rate, PR are welcome.

@mtrbean
Copy link

mtrbean commented Oct 21, 2016

I think the problem is that dask.__version__ is a unicode string u'0.11.1', which is a UnicodeType not a StringType. This causes the if condition on line 294 of distutils/version.py to fail, and the comparison fails. One workaround could be explicitly wrapping dask.__version__ with LooseVersion when comparing min version

@FrancescAlted
Copy link
Member

Ok, that seemed easy enough. Please shout if the fix does not work.

@alimanfoo
Copy link
Contributor Author

Looks good to me:

(bcolz_issue322) aliman@uluru:~$ pip install git+https://github.com/Blosc/bcolz.git
Collecting git+https://github.com/Blosc/bcolz.git
  Cloning https://github.com/Blosc/bcolz.git to /tmp/pip-aT5gg_-build
Collecting numpy>=1.7 (from bcolz==1.1.1.dev19)
  Downloading numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl (15.3MB)
    100% |████████████████████████████████| 15.3MB 102kB/s 
Installing collected packages: numpy, bcolz
  Running setup.py install for bcolz ... done
Successfully installed bcolz-1.1.1.dev19 numpy-1.11.2
(bcolz_issue322) aliman@uluru:~$ pip install dask
Collecting dask
  Using cached dask-0.11.1-py2.py3-none-any.whl
Installing collected packages: dask
Successfully installed dask-0.11.1
(bcolz_issue322) aliman@uluru:~$ pip install toolz
Collecting toolz
  Using cached toolz-0.8.0.tar.gz
Building wheels for collected packages: toolz
  Running setup.py bdist_wheel for toolz ... done
  Stored in directory: /home/aliman/.cache/pip/wheels/b0/84/bf/7089262387e8ea60bdefb1fdb84d2ee99427f6d09c9c7ba37d
Successfully built toolz
Installing collected packages: toolz
Successfully installed toolz-0.8.0
(bcolz_issue322) aliman@uluru:~$ python
Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bcolz
>>> bcolz.__version__
'1.1.1.dev19'

@tienduccao
Copy link

Thanks @alimanfoo, it worked for me

@alimanfoo
Copy link
Contributor Author

Hi @FrancescAlted, could you make a 1.1.1 release of bcolz including the fix for this issue? It is currently preventing the conda-forge recipe from building for PY27. xref #333, conda-forge/staged-recipes#2322

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

4 participants