简体   繁体   English

编辑python模块的代码

[英]editing code of a python module

Running pymatlab on my machine results in 在我的机器上运行pymatlab会导致

Exception AttributeError: "'MatlabSession' object has no attribute 'engine'" in > ignored

after the command session = pymatlab.session_factory() is run. 在运行session = pymatlab.session_factory()命令之后。

How to fix this problem has been discussed already here: 已经在此处讨论了如何解决此问题:

Running MATLAB from Python 从Python运行MATLAB

It looks like one line of code in the sessionfactory.py script in the pymatlab module has to be changed in a minor way. 看起来pymatlab模块中sessionfactory.py脚本中的一行代码似乎需要进行较小的更改。 The problem I have is that the pymatlab module which is installed on my machine is in .egg form and it doesn't look like it is possible to change the code directly with a text editor. 我的问题是我的机器上安装的pymatlab模块为.egg格式,看起来好像无法直接使用文本编辑器更改代码。 Any suggestions on how to do that? 有什么建议吗?

Thanks 谢谢

If you use easy_install , check How do I forbid easy_install from zipping eggs? 如果您使用easy_install ,请检查如何禁止easy_install压缩鸡蛋?

If you prefer pip (and you probably should ), check pip: “Editable” Installs , ie 如果您更喜欢pip (也许应该 ),请检查pip:“ Editable” Installs ,即

pip install -e pymatlab

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM