错误已附加。 我从Temp文件夹中的给定位置打开了该文件,它只包含文本“C:\Program”未被识别为内部或外部命令、可操作程序或批处理文件 任何帮助都将不胜感激
- OMPython - ERROR - OMC Server is down. Please start it! Log-file says:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Exception Traceback (most recent call last)
<ipython-input-3-2758f53a36c2> in <module>
----> 1 tank = ModelicaSystem('WaterTank.mo', 'WaterTank.ModWaterTank')
2 q = tank.getQuantities()
3 # print('Type of q: ', type(q))
4 type(q)
~\Anaconda3\lib\site-packages\OMPython\__init__.py in __init__(self, fileName, modelName, lmodel, useCorba)
679 self.getconn = OMCSession()
680 else:
--> 681 self.getconn = OMCSessionZMQ()
682 self.xmlFile = None
683 self.lmodel = lmodel # may be needed if model is derived from other model
~\Anaconda3\lib\site-packages\OMPython\__init__.py in __init__(self, readonly, timeout)
539 self._start_omc_process()
540 # connect to the running omc instance using CORBA
--> 541 self._connect_to_omc(timeout)
542
543 def __del__(self):
~\Anaconda3\lib\site-packages\OMPython\__init__.py in _connect_to_omc(self, timeout)
562 self._omc_log_file.close()
563 logger.error("OMC Server is down. Please start it! Log-file says:\n%s" % open(name).read())
--> 564 raise Exception("OMC Server is down. Could not open file %s" % self._port_file)
565 else:
566 continue
Exception: OMC Server is down. Could not open file C:/Users/RADICA~1/AppData/Local/Temp/openmodelica.port.7c438238bc7b4cbc89e2f7d57ab2e010
可能您使用的是较旧的OMPython,对我来说,它可以工作(即使在程序文件中安装了OpenModelica):
然后我用的是OMPython:
您可以尝试通过上面的第一个命令(使用pip)更新您的OMPython
在Windows上使用OMPython_1.18时也存在同样的问题: “OMPython-错误-OMC服务器已关闭。请启动它!日志文件显示: 在“C:\Program”之前,输入的是falsch geschrieben命令 “我不知道。”
这是因为路径“c:\程序文件”中的空白。
我在Python37\lib\site packages\OMPython\uem>init\uupy.py文件中添加了引号,如下所示: self.omhome=“”+omc\u env\u home+“””
这对我很有用
相关问题 更多 >
编程相关推荐