Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在IPython中导入sympy、scipy_Python_Macos_Enthought_Sympy_Canopy - Fatal编程技术网

无法在IPython中导入sympy、scipy

无法在IPython中导入sympy、scipy,python,macos,enthought,sympy,canopy,Python,Macos,Enthought,Sympy,Canopy,我无法使用Ipython从Mac终端导入scipy、sympy。 我的python发行版是Canopy,这也是我默认的python环境 (IPython别名为/Library/enthught/Canopy_64bit/User/bin/IPython。) 操作系统是OSX10.9 两次尝试中的错误是: In [3]: import sympy ---------------------------------------------------------------------------

我无法使用Ipython从Mac终端导入scipy、sympy。 我的python发行版是Canopy,这也是我默认的python环境 (IPython别名为/Library/enthught/Canopy_64bit/User/bin/IPython。)

操作系统是OSX10.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'
[3]中的
:导入sympy
---------------------------------------------------------------------------
AttributeError回溯(最近一次呼叫上次)
在()
---->1进口交响乐团
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site packages/sympy/__init__;u.py in()
68#此模块导入速度慢:
69#来自物理进口单位
--->70从绘图导入绘图、绘图、文本绘图、绘图\u后端、绘图\u隐式
71从打印导入pretty,pretty_打印,pprint,pprint_使用unicode\
72 P打印尝试使用unicode、打印gtk、打印树、寻呼机打印、表格格式
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site packages/sympy/plotting/__init__;y.py in()
---->1从绘图导入绘图_后端
2从绘图\隐式导入绘图\隐式
3从proxy_pyglet导入图
4从textplot导入textplot
5从pygletplot导入pygletplot
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site-packages/sympy/plotting/plot.py in()
29来自sympy.core.compatibility导入集\u union
30进口警告
--->31来自实验性_lambdify导入(矢量化_lambdify,lambdify)
32
33#TODO可能该行之后的所有导入都可以放在函数中
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site-packages/sympy/plotting/experimental_lambdify.py in()
71
72来自sympy.external import\u模块
--->73 np=导入模块(“numpy”)
74进口警告
75
/导入模块中的Users/nick/Library/enthught/Canopy\u 64bit/User/lib/python2.7/site-packages/sympy/external/importtools.py(模块、最小模块版本、最小python版本、未安装警告、旧版本警告、模块版本属性、模块版本属性调用参数、捕获)
121
请尝试:
-->123模块=导入(模块,**
124除恐怖主义外:
125如果未安装warn_:
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site packages/numpy/_uuuinit_uuuuuu.py in()
141返回加载器(*包,**选项)
142
-->143导入添加新文档
144 uuu all uuu=['add\u newdocs']
145
/Users/nick/Library/enthund/Canopy_64bit/User/lib/python2.7/site-packages/numpy/add_newdocs.py in()
7#core/fromnumeric.py,core/defmatrix.py为最新版本。
8.
---->9从numpy.lib导入添加新文档
10
11 ###############################################################################
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site packages/numpy/lib/__init___;.py in()
11
12将scimath导入为emath
--->13.从国外进口*
14#导入代码
15来自utils进口*
/Users/nick/Library/enthught/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/polymon.py in()
9进口稀土
10进口警告
--->11将numpy.core.numeric导入为NX
12
13来自numpy.core进口isscalar、abs、finfo、至少1d、hstack、dot
AttributeError:“模块”对象没有属性“核心”

我建议您删除:

~/Library/Enthought/Canopy_64bit/User/
重新启动天篷。将重新安装标准软件包。您需要重新安装/更新以前添加或更新的任何软件包


不要将mac端口与Corpody一起使用。它们不兼容。

重新安装模块。升级到Mavericks后出现了很多问题。我应该使用Canopy软件包管理器或通过终端和mac端口重新安装它吗?如果要修复Canopy,请使用Canopy的软件包管理器或enpkg命令行。