Maya 2020 MayaPy version is showing 3.8, expecting 2.7

Maya 2020 MayaPy version is showing 3.8, expecting 2.7

mostly_human
Advocate Advocate
3,784 Views
6 Replies
Message 1 of 7

Maya 2020 MayaPy version is showing 3.8, expecting 2.7

mostly_human
Advocate
Advocate

Just starting to learn Python and the learning resources I am using are all 2.7 but the mayapy.exe included with Maya 2020 is showing v3.8. I thought the vfx standard was still at 2.7 so I am a bit confused and having code incompatibility issues using this mayapy.exe with an external ide. If I check the python version in the maya script editor it does say 2.7. 

 

Specifically I am using PyCharm using mayapy.exe 3.8 as the interpreter, I also added the context files from the devkit.  If I type   

print "hello"

 It will underline it in red to show an error, but if I use python 3 syntax

print("hello")

It wont underline it in red.

And of course the Python 2 syntax does work correctly in Maya just not sure why the ide is doing what it's doing.

Accepted solutions (1)
3,785 Views
6 Replies
Replies (6)
Message 2 of 7

mostly_human
Advocate
Advocate

Okay, so I saw that the vfx reference is requiring Python 3 starting in 2020 which explains why the mayapy version has been updated, but why is the script editor still showing version 2.7?  How do I get Maya to use python 3?

Screenshot (741).png

0 Likes
Message 3 of 7

mostly_human
Advocate
Advocate

also, apologies, I did not mean to press the "need an answer" button, I meant to press reply, i was moving fast and they are the same color.  Then I pressed it again thinking it might remove the "need an answer" status but it just seemed to escalate it further.  

0 Likes
Message 4 of 7

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It should be 2.7. Do you have Python 3 installed on your computer? It could affect Maya's Python environment.

 

Maya 2020(released in CY2019) can't use Python 3. The next release(released in CY2020 or later) after Maya 2020 will use Python 3.

 

Yours,

Li

Message 5 of 7

mostly_human
Advocate
Advocate

I only have 2.7 installed.  I am completely stumped.  So the mayapy version in the 2020 bin directory definitely should not be showing up as 3.8 like it is?

0 Likes
Message 6 of 7

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

No, it shouldn't.

 

mayapy.png

 

Could you check your system environment? There are some other software could have installed or setup a Python 3 environment. 

 

Yours,

Li

 

Yours,

Li

0 Likes
Message 7 of 7

Anonymous
Not applicable

Hi,

 

I'm having the same issue. And it has not been resolved. It seems to come from PyCharm. There's a discussion about it here:

 

https://youtrack.jetbrains.com/issue/PY-39469