Dimitri Lucy Posted November 27, 2019 Report Share 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, Link to comment Share on other sites More sharing options...
Julian Martinz Posted November 28, 2019 Report Share 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) Link to comment Share on other sites More sharing options...
Dimitri Lucy Posted November 28, 2019 Author Report Share 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" Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted November 28, 2019 Report Share 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. Link to comment Share on other sites More sharing options...
Dimitri Lucy Posted November 28, 2019 Author Report Share 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 ! Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted November 28, 2019 Report Share Posted November 28, 2019 HI @Dimitri Lucy, glad to hear ! let us know if anything else comes up 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