Installing numpy broke NLTK (OS X 10.6.2, Python 2.6) -


I had a working installation of NLTK (PI-26-NLTK) on Mac (OS X 10.6.2). Then I installed numpy. Now when I try to import nltk, I get this:

  gt; & Gt; Import nltk traceback (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; The file "nltk / __init__.py", line 83, & lt; Module & gt; Import from Collocations * File "nltk / collocations.py", line 39, & lt; Module & gt; Nlt From Metrics Import, Attached Musers, Bigram ASSOC, Méisers, Trigram Essos Méisers file "nltk / metrics / __ init__.py", line 14, & lt; Module & gt; Score import * file from "nltk / metric / score", line 15, & lt; Module & gt; Bitai file from Scipy.stats.stats "/ Library / Framworks / Python. Framework / version-2.6 / Leib / Python 2 / site-package / SC / seat /__INIT__.py", in line 7, in & lt; Module & gt; Import from statistics * File "/ Library / Framworks / Python. Framework / Version-2.6 / Lib / Python 2/6 / Site-Package / SC / Stats / Stats", Line 203, & lt; Module & gt; The only reference to the find_repeats #scipy.stats file from Morestats import is "/ library / framework / Python.framework / version-2.6 / lib / python2.6 / site-packages / scipy / stats / morestats.py", in line 7, LT; Module & gt; Import distribution file "/ Library / Framework / Python. Framework / Version-2.6 / LIB / Python 2 / Site-package / SC / ESTAT / Distribution", in line 27, & lt; Module & gt; Import vonmises_cython file "numpy.pxd", line 30, scipy.stats.vonmises_cython (sipi / statistics / vonmises_cython.c: 2939) ValueError: numpy.dtype does not appear to be the correct type of object  

What's wrong? How can I fix this?

It seems that [version] SciPy and NumPy compared to between NLTK and Nompi Incompatibilities between versions
While SciPy is not required for NPL, it is an optional import, and will be loaded if available.

Your hypothesis:

Hype # 1

  • You were previously running under NPPY 1.3, as well as a compatible version of SciPy
  • You've recently installed NumPy 1.4, but have not touched SciPy ==> "Old" SciPy is broken. Remedy: Install new SciPy or uninstall it completely (though, depending on the NPL's usage / module of NPL, without knowing it, Optional Remedies: NumPy 1.3 to 1.4 Reinstall.

Hype # 2 (less likely)

  • You never felt cheated on SciPy and NLT
  • You recently got NumPy 1.4 (1.3 More than) and have installed SciPy (nothing)
  • Fo In some cases, NumPy and SciPy do not play well together Solution: Uninstall SciPy

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -