无法导入 SimPy

发布于 2024-12-11 04:00:09 字数 1717 浏览 0 评论 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

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文