我是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
发布于 2011-10-21 12:40:47
尝试:
from sympy import *
http://docs.sympy.org/0.7.1/tutorial.html#first-steps-with-sympy
https://stackoverflow.com/questions/7845020
复制相似问题