0

我是 SimPy 的新手,我使用 easy_install 安装 SimPy 模块,然后在命令行上我只是尝试过from SimPy.Simulation import *,但出现以下错误

Python 2.6.7 (r267:88850, Aug 22 2011, 14:13:38) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from SymPy.Simulation import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named SymPy.Simulation

我使用 easy_install 安装软件包,我安装了 simplejson 没有任何问题,当我导入 simplejson 时,我没有收到上述错误。我进行了更新,easy_install 成功更新了 SymPy 模块,但我仍然无法导入 SimPy 模块

[/Library/Python/2.6/site-packages]$easy_install -U SimPy
Searching for SimPy
Reading http://pypi.python.org/simple/SimPy/
Reading http://SimPy.SourceForge.net
Reading http://simpy.sourceforge.net/
Reading https://sourceforge.net/projects/simpy/files/
Reading http://pypi.python.org/simple/SimPy/simpy.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=62366
Best match: SimPy 2.2
Processing SimPy-2.2-py2.6.egg
SimPy 2.2 is already the active version in easy-install.pth

Using /Library/Python/2.6/site-packages/SimPy-2.2-py2.6.egg
Processing dependencies for SimPy
Finished processing dependencies for SimPy

我还检查了easy-install.pth文件,看起来所有内容都已正确添加。

[/Library/Python/2.6/site-packages]$more easy-install.pth 
import sys; sys.__plen = len(sys.path)
./simplejson-2.1.3-py2.6.egg
./SimPy-2.2-py2.6.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

如果我能在这方面得到任何帮助,那就太好了。

最好的; NH

4

1 回答 1

1

尝试:

from sympy import *

http://docs.sympy.org/0.7.1/tutorial.html#first-steps-with-sympy

于 2011-10-21T04:40:46.543 回答