Giter Club home page Giter Club logo

Comments (6)

PeterDSteinberg avatar PeterDSteinberg commented on May 29, 2024

Replicated the CI issue locally with:

conda create -n dask-searchcv-test -c conda-forge dask-searchcv python=2.7
source activate dask-searchcv-test
cd dask_searchcv/tests/
conda install pytest
py.test

from dask-searchcv.

TomAugspurger avatar TomAugspurger commented on May 29, 2024

Strange... I'm not able to reproduce this locally.

Will take a closer look later.

from dask-searchcv.

jcrist avatar jcrist commented on May 29, 2024

I just ran into this myself in a different library. The error occurs when the non-LooseVersion is a unicode object in python 2:

>>> from distutils.version import LooseVersion
>>> LooseVersion('0.21.0') < u'0.21.0'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jcrist/anaconda/envs/py27/lib/python2.7/distutils/version.py", line 296, in __cmp__
    return cmp(self.version, other.version)
AttributeError: 'unicode' object has no attribute 'version'

However, I'm baffled how this is happening in the code, since the strings compared are just the default string type (not unicode at all). I'm unable to reproduce locally for either this issue or others. Googling turns up a few other occurrences of this, but none of them offer suggestions as to why this happens.

from dask-searchcv.

TomAugspurger avatar TomAugspurger commented on May 29, 2024

Possibly someone imports unicode_literals?

In [1]: from distutils.version import LooseVersion

In [2]: LooseVersion('0.21.0') < '0.21.0'
Out[2]: False

In [3]: from __future__ import unicode_literals

In [4]: LooseVersion('0.21.0') < '0.21.0'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-8b388f046a2e> in <module>()
----> 1 LooseVersion('0.21.0') < '0.21.0'

/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/version.pyc in __cmp__(self, other)
    294             other = LooseVersion(other)
    295
--> 296         return cmp(self.version, other.version)
    297
    298

AttributeError: 'unicode' object has no attribute 'version'

I'll search around, but IIRC the current recommendation is that libraries not import unicode literals.

from dask-searchcv.

TomAugspurger avatar TomAugspurger commented on May 29, 2024

http://python-future.org/unicode_literals.html waffles. I suppose that means libraries should not use unicode_literals, since they can't assume downstream applications are expecting it to be turned on.

@PeterDSteinberg I noticed elm does import unicode_literals. Does that stem from a specific issue, or convenience?

from dask-searchcv.

jcrist avatar jcrist commented on May 29, 2024

Closing as this isn't an issue with dask-searchcv directly.

from dask-searchcv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.