Jump to content

"ftrack_api" in maya, No module named builtins


Hadrien FARRE

Recommended Posts

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

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

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

  • 1 year later...

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

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...