【问题标题】:What is wrong with this SimPy installation?这个 SimPy 安装有什么问题?
【发布时间】:2009-05-03 02:36:53
【问题描述】:

好吧,我试了很多次

python setup.py install 

来自我的命令提示符的命令

当你尝试这个时:

from SimPy.Simulation import *

在空闲时,我明白了:

Traceback (most recent call last):
  File "C:/Python30/pruebas/prueba1", line 1, in <module>
    from SimPy.Simulation import *
  File "C:\Python30\SimPy\Simulation.py", line 320
    print 'SimPy.Simulation %s' %__version__,
                              ^
SyntaxError: invalid syntax
>>> 

【问题讨论】:

    标签: python windows installation simpy


    【解决方案1】:

    并非每个模块都支持 python 3 - 事实上,现在 90% 或更多的模块都支持 2.x。

    你应该为这个模块使用 2.5 或 2.6,或者找一个兼容 3.0 的 simpy。

    您也可以运行 2->3 升级脚本来修改您的 simpy 源,但我不建议这样做。

    【讨论】:

      【解决方案2】:

      我有类似的错误,我安装了python 2.6.4,所以我认为你不能使用旧版本的python来解决你的问题。

      alumno@ubuntu:/usr/local/SimPy/SimPy$ python carro.py
      
      Traceback (most recent call last):
        File "carro.py", line 2, in <module>
      
      from SimPy.Simulation  import *
      
      ImportError: No module named SimPy.Simulation
      

      Python 2.6.4rc2(r264rc2:75497,2009 年 10 月 20 日,02:55:11) [GCC 4.4.1] 在 linux2 上

      【讨论】:

        【解决方案3】:

        请参阅第 4 点: http://pythonhosted.org/SimPy/Manuals/INSTALLATION.html 解决方法。它对我有用。

        通过使用 pip install SimPy 命令,simpy 包似乎没有与 SimPy 相同的类,simpy 被安装。

        因此,只需从链接下载 SimPy 包并将其复制到您的 python 类路径。

        【讨论】:

          【解决方案4】:

          您的 Python 安装没有问题。 SimPy 1 和 SimPy 2 使用与 SimPy 3 截然不同的语法,SimPy 3 是您安装的版本 - 并且是广泛可用的版本。旧教程都是针对旧版 SimPy 编写的。查看此页面...

          http://simpy.readthedocs.org/en/latest/simpy_intro/installation.html

          【讨论】:

            猜你喜欢
            • 2020-10-31
            • 2011-05-05
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多