P4python doesn't work under maya 2017

895 views
Skip to first unread message

riga_rig

unread,
Sep 28, 2017, 8:20:55 AM9/28/17
to Python Programming for Autodesk Maya
Hi,
I tried to access our perforce server from Maya 2017.
from P4 import P4,P4Exception    # Import the module
p4 = P4()                        # Create the P4 instance
#p4.host = "ssl:perforce:1666"
p4.port = "ssl:perforce:1666"
p4.user = "user_name"
p4.password = "secret"
p4.client = "my_workspace"    # Set some environment variables
p4.connect()

It works good from  external python console, but in Script Editor I got following error:
# Error: line 1: [P4.connect()] Connect to server failed; check $P4PORT.
# SSL library must be at least version 1.0.1.
# Traceback (most recent call last):
#   File "<maya console>", line 8, in <module>
#   File "C:\Program Files\Autodesk\Maya2017\Python\lib\site-packages\P4.py", line 798, in connect
#     P4API.P4Adapter.connect( self )
# P4Exception: [P4.connect()] Connect to server failed; check $P4PORT.
# SSL library must be at least version 1.0.1. # 

I'm under Windows 10. P4Python was installed from p4python-2017.1.1526044-cp27-cp27m-win_amd64.whl.

Python version in Maya 2017:
import sys
sys.version
# Result: 2.7.11 (default, Dec 21 2015, 22:48:54) [MSC v.1700 64 bit (AMD64)]

Do you have any ideas how to fix it?
Is anybody uses Perforce P4Python lib from Maya?
Regards,
Oleg Solovjov

Robert White

unread,
Sep 28, 2017, 8:46:22 AM9/28/17
to Python Programming for Autodesk Maya
Last job I was using the version that I've shared here, I had tested it up through 2017, but it might work in 2018 as well (no promises on 2018).
It was compiled with OpenSSL-1.0.2c, so that should potentially help with your SSL version error.

Todd Widup

unread,
Sep 28, 2017, 12:07:22 PM9/28/17
to python_in...@googlegroups.com
hey Robert..is there any documentation on your compile?  like what syntax its looking for and such, or do I have to do run("p4 command","files")


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/829fec84-43fd-4418-859e-d5611437b49e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Todd Widup
Creature TD / Technical Artist
todd....@gmail.com

Robert White

unread,
Sep 28, 2017, 12:52:33 PM9/28/17
to Python Programming for Autodesk Maya
It should behave the same as any other version of P4Python. All I did was include the OpenSSL value, and compile it with a maya compatible compiler version.

riga_rig

unread,
Sep 29, 2017, 7:09:59 AM9/29/17
to Python Programming for Autodesk Maya
I don't think it's a SSL version error, because it works in external python.
I just moved to my Maya2017\Python\Lib\site-packages three files P4.py, P4API.py and P4API.pyd.
It's doesn't work from Maya's script editor. Do I forget to move something else from external_python27\Lib\site-packages ?

I tried you files and last version from Perforce site - the same result.

riga_rig

unread,
Oct 2, 2017, 5:57:37 AM10/2/17
to Python Programming for Autodesk Maya
It's looks like Maya has [MSC v.1700 64 bit (AMD64)]  Python and I installed another one Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32.
Where i can find Python 2.7 installer witch is compiled with  [MSC v.1700 64 bit (AMD64)] ?

Marcus Ottosson

unread,
Oct 2, 2017, 6:31:02 AM10/2/17
to python_in...@googlegroups.com
You've already got one, mayapy is a fully qualified Python distribution that you can use to run and compile things with. Other than that, you'll probably need to build one for yourself.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

riga_rig

unread,
Oct 2, 2017, 8:02:29 AM10/2/17
to Python Programming for Autodesk Maya
Thank you Robert, your files are working good.


On Thursday, September 28, 2017 at 2:46:22 PM UTC+2, Robert White wrote:
Reply all
Reply to author
Forward
0 new messages