Jump to content

Ftrack3 integration in Visual Studio


laura.c

Recommended Posts

Hi guys,

 

I need to use ftrack in VisualStudio 2012. Unfortunately, I always get "Attempted relative import in non-package" when trying to import ftrack.

 

With SetSearchPaths() I set the path to python-api location as "......../python-api/". Is there anything else I need to define in order to import ftrack?

 

 

thank you,

Laura

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi Mattias,

 

Thanks for your answer.

 

I am testing it in a very simple way, in Visual Studio 13, interactive windows:

 

 

Python 64-bit 2.7: it works

 

IronPython 2.7: I get :

>>> import sys>>> sys.path.insert(0,<FtrackPythonApiPath>)>>> sys.path.insert(0,<FtrackPythonApiPath>\FTrackCore)>>> sys.path.insert(0,<FtrackPythonApiPath>\api)>>> import ftrackTraceback (most recent call last):  File "<string>", line 1, in <module>  File "<FtrackPythonApiPath>\ftrack.py", line 20, in <module>    from FTrackCore import *  File "<FtrackPythonApiPath>\FTrackCore\__init__.py", line 8, in <module>    from .api.client import *  File "<FtrackPythonApiPath>\FTrackCore\api\client.py", line 22, in <module>    from group import Group, getGroups  File "<FtrackPythonApiPath>\FTrackCore\api\group.py", line 4, in <module>    from .ftobject import FTObjectValueError: Attempted relative import in non-package

Do I need to add some other paths or to import some modules?

 

Thanks.

 

Best,

Laura

Link to comment
Share on other sites

Hi Martin,

 

already tried and I get

Traceback (most recent call last):  File "<string>", line 1, in <module>  File "<FtrackPythonApiPath>\ftrack.py", line 20, in <module>    from FTrackCore import *  File "<FtrackPythonApiPath>\FTrackCore\__init__.py", line 8, in <module>    from .api.client import *  File "<FtrackPythonApiPath>\FTrackCore\api\client.py", line 22, in <module>    from group import Group, getGroupsImportError: No module named group

That's why I added the location for "group" module: <FtrackPythonApiPath>\FTrackCore\api.

 

Laura

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...