简体   繁体   中英

Using Python OpenMDAO in an IDE (PyScripter)

I'm trying to use the OpenMDAO package in the PyScripter IDE, running Python2.7 on Windows 8. But trying to import openmdao I'm returned with the error "No module named openmdao". The OpenMDAO installation instructions say to (i) run the go-openmdao.py script, and (ii) enter Scripts\\activate.bat . How do I do (ii) in PyScripter, or any IDE for that matter?

Thank you, Alex

I've been able to use OpenMDAO in an IDE (Spyder) by changing the path to the Python executable in the Spyer preferences from the default system binary to the one inside of the virtualenv directory. If you can do this, the IDE will be operating within the virtualenv, and OpenMDAO should become importable. This should also work for any other python virtualenv that you would like to use within an IDE.

I have used it with PyCharm. It works very well. You can import the virtual environment created by openMDAO in the preferencies/project/interpreter/add local. PyCharm community version is free and has a nice debugging support, so I can recommend it for beginners in python. I never heard about PyScripter, but if there is a place where you can change the default python executable to the one in openmdao/Script, that might work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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