Hadrien FARRE Posted December 10, 2020 Report Share Posted December 10, 2020 Hello, I'm starting with the ftrack_python_api and wanted to launch it from the maya script editor directly. I followed two things I found on the forum : updating the PYTHONPATH to add my site-packages folder in env var, for exemple : PYTHONPATH = %PYTHONPATH%;C:\Users\Kombbo_05\AppData\Roaming\Python\Python39\site-packages creating a virtual environment to re-install the api properly and then in Maya script editor use : import sys sys.path.insert(0, 'C:\Users\Hadrien\api-test\Lib\site-packages') But in both cases when I try the "import ftrack_api", I've got this error : # Error: ImportError: file C:/Users/Hadrien/api-test/Lib/site-packages\ftrack_api\session.py line 7: No module named builtins # It seems that the missing module is part of "future" but ftrack_api can't find it, and the strange thing is that if I launch "from future import builtins", it works... Is there a python path to add more ? or something maybe I missed Thanks for your help Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted December 10, 2020 Report Share Posted December 10, 2020 hi @Hadrien FARRE this error often comes from a mix up between python 3 and python2, usually trying to load python2 in python3 interpreter. Also can see you are using python 3.9 , although supposed to be working , we currently support up to 3.8 with a closer eye to 3.7. hope it helps. L. Link to comment Share on other sites More sharing options...
Hadrien FARRE Posted December 10, 2020 Author Report Share Posted December 10, 2020 Ha ok ! I didn't thought about it, so technically if I downgrade my python it should work ? I'll give it a try with a lower version Link to comment Share on other sites More sharing options...
Hadrien FARRE Posted December 10, 2020 Author Report Share Posted December 10, 2020 Ok so I downgraded to python 2.7.17, but it seems to have a conflict with a module in "future" # Error: AttributeError: file C:\Python27\Lib\site-packages\future\standard_library\__init__.py line 462: 'module' object has no attribute 'getoutput' # And with python 3.6 I still have : # Error: ImportError: file C:\Python36\Lib\site-packages\ftrack_api\session.py line 7: No module named builtins # I search the getoutput problem on the internet, but I didn't really find any working solution 😕 I forgot to notice I launch maya 2020 Link to comment Share on other sites More sharing options...
Hadrien FARRE Posted December 10, 2020 Author Report Share Posted December 10, 2020 Update on the search: Ok, so apparently, the trouble was with the commands.py that is in C:\Python27\Lib For some strange reason, when in maya, you type import commands, it doesn't import the commands form C:\Python27\Lib but from somewhere else. And this other commands doesn't have the attributes. When making a dir on it : ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__'] So I juste copy/paste the commands.py from C:\Python27\Lib to C:\Python27\Lib\site-packages and C:\Python27\Lib\site-packages\future and now in Maya when I try dir (commands) I get : ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'getoutput', 'getstatus', 'getstatusoutput', 'mk2arg', 'mkarg'] And ftrack seems to works in maya 2020 python 2.7.17 I'll continue to look for a way to make it work with python 3.7 Link to comment Share on other sites More sharing options...
Soal GIVORD Posted February 4, 2022 Report Share Posted February 4, 2022 Hello Hadrien, i have the same issue with python 3.7.9 and Maya 2020.4 i also got this message : \ftrack_api\session.py line 7: No module named builtins # Did you find a way to make it work with python 3.7? @Ftrack support : Is there a good way to us Ftrack Python API with Maya? Thanks Best regards Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted April 11, 2022 Report Share Posted April 11, 2022 @Soal GIVORD @Hadrien FARRE As it seems you are both on Maya 2020.X could you please check if your issues are related to this maya bug ? We have many users importing and using daily our api in maya and this is the few issue we have been told so far. Please let us know if you still have issues. L. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now