Py3K early access
3 3

6 posts in this topic

Please note, the current development status is in Beta stage and is not suitable for production.

Welcome to the ftrack-python-api tech preview for python 3.x compatibility.
Here are some brief instructions on how to start testing the upcoming release of the new API.

We strongly recommend sandboxing the testing environment using virtualenv.

Prepare your sandbox

Create a virtualenv with the Python 3 interpreter:

$ virtualenv -p `which python3.6` ~/ftrack_python_api_py3k

Activate virtualenv:

$ source ~/ftrack_python_api_py3k/bin/activate

Install

Install from the development branch:

$ pip install git+https://bitbucket.org/ftrack/ftrack-python-api.git@backlog/ftrack-python-api-compatibility-with-python-3

Test

Run python from virtualenv and check that everything is in place:

(ftrack_python_api_py3k) $ python -V
(ftrack_python_api_py3k) $ Python 3.6.5


You can now start the Python interpreter and start using the API as usual.

>>> from ftrack_api import Session
>>> session = Session()
>>> projects = session.query('Project').all()
>>> print(projects)

If you need to use the Python3 and the ftrack module just run Python directly from the virtualenv using:

$ ~/ftrack_python_api_py3k/bin/python3 -c "import ftrack_api;print(ftrack_api.__version__)"



Bug reporting

Please use this thread to report issues and bugs.

When reporting bugs, please remember to include:

* Operating system in use.
* Python version in use (use: python -V).
* Full stack trace or error.

Share this post


Link to post
Share on other sites

Installing and testing the api in Blender

  • Go to the blender's python folder (blender <version>/<version>/python/bin/)
  • Ensure pip is installed with:
    ./Python3.7m  -m ensurepip

     

  • Install the api using pip: 
    ./pip3 install git+https://bitbucket.org/ftrack/ftrack-python-api.git@backlog/ftrack-python-api-compatibility-with-python-3
  • as alternative is possible to run the pip module directly from python with:
     ./python -m pip install git+https://bitbucket.org/ftrack/ftrack-python-api.git@backlog/ftrack-python-api-compatibility-with-python-3
  • If you want/need to have this included in your requirements.txt you can use the the pip editable syntax as such :
    (in your requirements.txt)

     
    [...]
    someothermodule >= 0.2
    -e git+https://bitbucket.org/ftrack/ftrack-python-api.git@backlog/ftrack-python-api-compatibility-with-python-3#egg=ftrack-python-api
    [...]
    


     
  • Launch Blender and open Python Console to test the api

Share this post


Link to post
Share on other sites

We have been restarting the work on the Python api with Python3k support.
There's a new branch  ( backlog/api-2.0/story ) to use to pick the latest and greatest, and it'll be used until the official release.

Here how to update the above snippets to use it:

  • ./pip3 install git+https://bitbucket.org/ftrack/ftrack-python-api.git@backlog/api-2.0/story

If you do have any question of you find any issue please let us know.

 

Share this post


Link to post
Share on other sites

Hi. 

We'll try updating to this latest branch.  We've been using the previous one for python 3 for almost a year with only one problem, that we're running into now. It's compatible with either python3 or python 2, but doesn't work in mixed environment. So if we install it with pip3 and then try loading it to maya, it crashes on multilpe wrong imports. We'll investigate more closely and post here.

Share this post


Link to post
Share on other sites

HI @Milan Kolar, Thanks for reporting it.
I wasn't aware you were already using it ! 
Be aware that some breaking changes (session won't connect automatically to the event hub) are coming soon on the story branch so be careful.

Feel free to get in touch through support to share any stack trace you might be getting.
Cheers.

L.
 

Share this post


Link to post
Share on other sites

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
3 3