Chrispy
Chrispy

Reputation: 1330

Anacondas install messed with IPython pandas import?

I'm using IPython and pandas to do some number crunching, and recently installed Anaconda to try something out. I don't have virtualenv set up (I now learned my lesson as to why that is so valuable) and it must have tweaked something and now I'm getting an error importing pandas into my script. So far I've been able to find out that the pandas import is causing some trouble with an intel library libmkl_intel_lp64.dylib, but not much beyond that.

Sorry for the noobishness, can someone provide some insight on how to approach a solution? Thanks!

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/ibebian/anaconda/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    202             else:
    203                 filename = fname
--> 204             __builtin__.execfile(filename, *where)

/Users/ibebian/Desktop/DB-Analyzer/pandas_test.py in <module>()
      2 
      3 
----> 4 from pandas import Series, DataFrame
      5 import pandas as pd
      6 from datetime import datetime, timedelta

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/__init__.py in <module>()
      4 
      5 try:
----> 6     from . import hashtable, tslib, lib
      7 except Exception:  # pragma: no cover
      8     import sys

/Users/ibebian/Desktop/DB-Analyzer/numpy.pxd in init pandas.hashtable (pandas/hashtable.c:19547)()

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/__init__.pyc in <module>()
    141         return loader(*packages, **options)
    142 
--> 143     import add_newdocs
    144     __all__ = ['add_newdocs']
    145 

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
      7 #       core/fromnumeric.py, core/defmatrix.py up-to-date.
      8 
----> 9 from numpy.lib import add_newdoc
     10 
     11 ###############################################################################

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
     11 
     12 import scimath as emath
---> 13 from polynomial import *
     14 #import convertcode
     15 from utils import *

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>()
     15 from numpy.lib.function_base import trim_zeros, sort_complex
     16 from numpy.lib.type_check import iscomplex, real, imag
---> 17 from numpy.linalg import eigvals, lstsq, inv
     18 
     19 class RankWarning(UserWarning):

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/__init__.py in <module>()
     46 from info import __doc__
     47 
---> 48 from linalg import *
     49 
     50 from numpy.testing import Tester

/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/linalg.py in <module>()
     21         isfinite, size, finfo, absolute, log, exp
     22 from numpy.lib import triu
---> 23 from numpy.linalg import lapack_lite
     24 from numpy.matrixlib.defmatrix import matrix_power
     25 from numpy.compat import asbytes

ImportError: dlopen(/Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so, 2): Library not loaded: @rpath/libmkl_intel_lp64.dylib
  Referenced from: /Users/ibebian/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so
  Reason: image not found

Upvotes: 3

Views: 1412

Answers (2)

asmeurer
asmeurer

Reputation: 91490

If you look at the traceback, you can see that it's loading things from Canopy, even though you are starting with Anaconda. This usually means you have PYTHONPATH set. You should unset it.

Upvotes: 1

Saullo G. P. Castro
Saullo G. P. Castro

Reputation: 58895

Check the environment variables PATH which should contain some path to the directory where Anaconda was installed, you will have to remove it in order to avoid calling the Anaconda's Python.

Then check PYTHONPATH, wich tells Python from where the modules should be imported, if there is any path to Anaconda's packages you can also remove it.

And finally, as you already realized... virtualenv is strongly recommended.

Upvotes: 0

Related Questions