Dimitri Lucy Posted November 27, 2019 Report Posted November 27, 2019 Hello, I hope it's the good place for this question.. I need to try some pythons snippets in maya, with ftrack_api. So, Is it possible to "import ftrack_api" in maya, without launching maya with connect ? I can import it in a shell/terminal but, not in maya.. thanks in advance,
Julian Martinz Posted November 28, 2019 Report Posted November 28, 2019 Your PYTHONPATH has to be set accordingly. Which OS? And how do you start maya? If you start Maya from the same terminal-session from where you can import the api in an interactive python session, you should be able to import the api inside Maya as well. Edit: Obviously the PYTHONPATH has to be set in the bash-session (or whatever shell you use)
Dimitri Lucy Posted November 28, 2019 Author Report Posted November 28, 2019 I'm on Windows 10, maya 2018 Python 2.7.17 ftrack python api installed by "pip install ftrack-python-api" I start maya with classic maya executable. I added a var sytem : PYTHONPATH =C:\Python27\Lib\site-packages\ftrack_api In terminal, it's ok but in maya "ImportError: No module named ftrack"
Lorenzo Angeli Posted November 28, 2019 Report Posted November 28, 2019 Hi @Dimitri Lucy, whenever you are manipulating the PYTHONPATH I suggest extending it rather than overwriting it with something like : PYTHONPATH=%PYTONPATH%:C:\Python27\Lib\site-packages\ftrack_api On the error you are having though, seems to me that you are installing the new api , but trying to import the legacy ones. Could you please try to import ftrack_api rather than ftrack ? Let us know how it goes ! Cheers. L.
Dimitri Lucy Posted November 28, 2019 Author Report Posted November 28, 2019 Thank you ! It's working now, it was a mistake by me, two different python version in conflict + old legacy api thanks !
Lorenzo Angeli Posted November 28, 2019 Report Posted November 28, 2019 HI @Dimitri Lucy, glad to hear ! let us know if anything else comes up L.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.