This might be a stupid question, I’m pretty sure it is. I’m looking for a Python IDE similar to the script editor in Maya I started coding Python with Maya, and I never really switched over to anything else when writing Python scripts, even if they were meant to be used outside of Maya. I’ve tried PyCharm and a couple of other IDE’s, but they have so much more than what I need.
I really just want something as simple as the script editor in Maya, where I don’t have to define a project before running code, and the option to just run selected code without having to configure the program. Is there anything like this? I would have kept using Maya if it wasn’t for the issues with imporing external libraries :rolleyes:
Something as Sublime is a lot cleaner as well, though I really like the feature set and customizability PyCharm provides. Getting PyCharm to work with the maya.cmds library etc is quite easy and can be found on this forum.
But what do you mean with; ‘issue with importing external libraries’. Just add the library-directories to sys.path, set them up in the Maya.env file, set them up in a userSetup.py file… so many possibilities to source directories containing modules :nod:
So Maya isn’t really an IDE, its a hugely overblown interpreter / live-coding environment
However there are some python tools that do work similarly.
I use iPythona lot, it has an enhanced interpreter mode, a Qt based console mode (which is an extra pretty interpreter + toys), and then the notebook web interface mode. The notebook option is rather awesome to work with as you can rerun cells at any time, much like the “hightlight + run” option you get inside maya.
Another enhanced interpreter you can try out is dreampie, the interface looks more like Maya’s with the split between a space for entering code, and a space for results. It can be a bit finicky about comments and docstrings when doing huge copy / pastes, and I can’t remember if you can do partial execution (its been a few years since the last time I used it).
The other option is to use a simpler text editor and using Maya’s commandPort to send over information. SublimeText has one of these, I’m also fairly sure that jedit, and notepad++ have similar options.
Thanks everyone! :): Dreampie turned out to be EXACTLY what I was looking for :D:
EDIT: Looks like I get the same problem with external libraries though. I’ve never got the external libraries to work by just appending them to the sys.path :(:
Traceback (most recent call last):
File "<pyshell#5>", line 4, in <module>
import numpy
File "C:\Python27\lib\site-packages
umpy\__init__.py", line 200, in <module>
from . import add_newdocs
File "C:\Python27\lib\site-packages
umpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages
umpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python27\lib\site-packages
umpy\lib ype_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages
umpy\core\__init__.py", line 14, in <module>
from . import multiarray
ImportError: cannot import name multiarray
Are you trying to use python 2.7 libraries with maya?
Because if so, compiled c-extensions (like numpy) libraries won’t be compatible.
Basically default python 2.7 is compiled with Visual Studio 2008, which ties it to a version specific c-runtime, Autodesk uses more modern versions, (Maya2014 == Visual Studio 2010, Maya2015 == Maya2016 == Visual Studio 2012), which means you need to recompile any c-extensions before they will work inside maya, or mayapy.
Okay, so I just installed Dreampie again. I’m not sure what it uses to find its initial interpreter, but it defaulted to my installation of IronPython.
So I would check and make sure the interpreter it is using is the same as the python shell you’re testing in.
Because if it found a version of python3, or say 2.6, then looking for numpy in python27 will obviously cause problems.
Easiest way it to check the version, is just to startup a new instance and see what the startup message says.
That’s weird, I’ve checked that Dreampie points to C:\Python27\python.exe. I’ve even uninstalled python, deleted the entire folder and reinstalled it, installed the packages and tested that it works with the standard python shell… Still can’t get it to work with Dreampie, so weird!