1. Matt Chaput
  2. whoosh
  3. Issues
Issue #188 resolved

got error when trying to import whoosh.fields

Anonymous created an issue

Hi Matt,

I'm just trying out whoosh by following the quick start guide at http://packages.python.org/Whoosh/quickstart.html and got this error:

...... Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from whoosh.index import create_in from whoosh.fields import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build\bdist.win32\egg\whoosh\fields.py", line 55, in <module> ValueError: invalid literal for float(): nan ........

Am I missing something?

Comments (8)

  1. Anonymous

    Sorry I forgot to specify the version, it is 2.2.2. Here is the message I got during installation:

    C:\Documents and Settings\me>easy_install Whoosh Searching for Whoosh Reading http://pypi.python.org/simple/Whoosh/ Reading http://bitbucket.org/mchaput/whoosh Reading http://whoosh.ca Best match: Whoosh 2.2.2 Downloading http://pypi.python.org/packages/source/W/Whoosh/Whoosh-2.2.2.zip#md5=1d2ba09dadaa3c5ae21 6707db3403279 Processing Whoosh-2.2.2.zip Running Whoosh-2.2.2\setup.py -q bdist_egg --dist-dir c:\docume1\me\locals1\temp\easy_install- yuqpwk\Whoosh-2.2.2\egg-dist-tmp-ag0sbf warning: no files found matching '*.txt' under directory 'tests' warning: no files found matching '*.txt' under directory 'benchmark' warning: no files found matching '*.txt' under directory 'files' warning: no files found matching '*.py' under directory 'files' warning: no files found matching '*.jpg' under directory 'files' SyntaxError: ('future feature print_function is not defined',)

    Adding whoosh 2.2.2 to easy-install.pth file

    Installed c:\python25\lib\site-packages\whoosh-2.2.2-py2.5.egg Processing dependencies for Whoosh Finished processing dependencies for Whoosh

  2. Matt Chaput repo owner

    Hmm, apparently you're on an architecture where float("nan") doesn't work. It works for me on Windows (32 bit Python on 64-bit Windows 7), so I don't really understand why it's not working for you, but I'll look for a more reliable way to get a NaN float in Python.

  3. Anonymous

    Yes you are right. I'm trying to use it on app engine, which only supports 2.5. Is it possible to have it compatible to 2.5?

  4. Hideaki Takahashi

    Hi,

    The struct-based method doesn't work on python3(I checked on 3.2.2).

    It cause "TypeError: 'str' does not support the buffer interface"

    I think that the definition of NaN would be better to moves to compat.py. then use float("nan") and the struct-based method.

  5. Log in to comment