首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法导入SimPy

无法导入SimPy
EN

Stack Overflow用户
提问于 2011-10-21 12:35:24
回答 1查看 3K关注 0票数 0

我是SimPy新手,我使用easy_install安装了SimPy模块,然后在命令行上简单地尝试了from SimPy.Simulation import *,但得到了以下错误

代码语言:javascript
复制
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模块

代码语言:javascript
复制
[/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文件,看起来一切都已正确添加。

代码语言:javascript
复制
[/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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-10-21 12:40:47

尝试:

from sympy import *

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7845020

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档