2013-11-04 100 views
0

我無法使用Ipython從Mac終端導入scipy,sympy。 我的蟒蛇分佈是樹冠,這也是我的默認Python環境 (IPython的化名爲/庫/ Enthought/Canopy_64bit /用戶/箱/ IPython中)。無法在IPython中導入sympy,scipy

的抗工系統是OS X 10.9。

的錯誤都嘗試是:

In [3]: import sympy 
--------------------------------------------------------------------------- 
AttributeError       Traceback (most recent call last) 
<ipython-input-3-7fb0c7cf9177> in <module>() 
----> 1 import sympy 

/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy/__init__.py in <module>() 
    68 # This module is slow to import: 
    69 #from physics import units 
---> 70 from plotting import plot, Plot, textplot, plot_backends, plot_implicit 
    71 from printing import pretty, pretty_print, pprint, pprint_use_unicode, \ 
    72  pprint_try_use_unicode, print_gtk, print_tree, pager_print, TableForm 

/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy/plotting/__init__.py in <module>() 
----> 1 from plot import plot_backends 
     2 from plot_implicit import plot_implicit 
     3 from proxy_pyglet import Plot 
     4 from textplot import textplot 
     5 from pygletplot import PygletPlot 

/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy/plotting/plot.py in <module>() 
    29 from sympy.core.compatibility import set_union 
    30 import warnings 
---> 31 from experimental_lambdify import (vectorized_lambdify, lambdify) 
    32 
    33 #TODO probably all of the imports after this line can be put inside function to 

/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy/plotting/experimental_lambdify.py in <module>() 
    71 
    72 from sympy.external import import_module 
---> 73 np = import_module('numpy') 
    74 import warnings 
    75 

/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy/external/importtools.py in import_module(module, min_module_version, min_python_version, warn_not_installed, warn_old_version, module_version_attr, module_version_attr_call_args, __import__kwargs, catch) 
    121 
    122  try: 
--> 123   mod = __import__(module, **__import__kwargs) 
    124  except ImportError: 
    125   if warn_not_installed: 

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

/Users/nick/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/nick/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/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>() 
     9 import re 
    10 import warnings 
---> 11 import numpy.core.numeric as NX 
    12 
    13 from numpy.core import isscalar, abs, finfo, atleast_1d, hstack, dot 

AttributeError: 'module' object has no attribute 'core' 
+1

重新安裝模塊。升級小牛後發生了很多問題。 – moenad

+0

我應該使用Canopy Package Manager還是通過終端和Mac端口重新安裝它? – bergercookie

+1

如果您想修復Canopy,請使用Canopy的包管理器或enpkg命令行。 – jonathanrocher

回答

0

我建議你刪除:

~/Library/Enthought/Canopy_64bit/User/ 

,並重新啓動篷。標準軟件包將被重新安裝。您將需要重新安裝/更新您之前添加或更新的任何軟件包。

不要在Canopy上使用mac端口。它們不兼容。