无法导入 SimPy
我是 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
I am new to SimPy I used the easy_install to install SimPy module then on the command line I simply tried from SimPy.Simulation import *
but I get the following error
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
I use easy_install to install packages, I have simplejson install without any problem and when I import simplejson I don't get the above error. I did an update and easy_install successfully updated the SymPy module yet I still cant import the SimPy Module
[/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
I also check the easy-install.pth
file, and looks like everything has been added properly.
[/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)
It will be great if I could get any help on this.
Best;
NH
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
from sympy import *
http://docs.sympy.org/0.7.1/tutorial.html#first-steps-with-sympy
Try:
from sympy import *
http://docs.sympy.org/0.7.1/tutorial.html#first-steps-with-sympy