pip install ftrack-connect
3 3

15 posts in this topic

Hey guys,

I just tried installing ftrack-connect through `pip install --target=C:\work\pipeline\dev\app\python git+https://bitbucket.org/ftrack/ftrack-connect.git`.

The installation seemed to go smooth, but after the installation I tried running the ftrack connect service with: `python -m ftrack_connect`.

That gave me the following error:

```

Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\work\pipeline\dev\apps\python\ftrack_connect\__main__.py", line 29, in <module>
    import ftrack_connect.ui.application
  File "C:\work\pipeline\dev\apps\python\ftrack_connect\ui\application.py", line 14, in <module>
    import ftrack_api._centralized_storage_scenario
ImportError: No module named _centralized_storage_scenario

```

Any idea what might be going wrong?

 

--

 

Edit: How can I do code highlighting here on the forum? :)

Share this post


Link to post
Share on other sites

Hi,

Just to be clear, you do want to install and use ftrack Connect this way rather than downloading our pre-built package:

https://www.ftrack.com/portfolio/connect

The problem you see is because the Connect master HEAD relies on a version of ftrack-python-api that is not released yet. Try and checkout tag 0.1.19 from the git repo.

As for the code highlighting there is a button, "Code", that you can use to insert code into your posts:

 

Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\work\pipeline\dev\apps\python\ftrack_connect\__main__.py", line 29, in <module>
    import ftrack_connect.ui.application
  File "C:\work\pipeline\dev\apps\python\ftrack_connect\ui\application.py", line 14, in <module>
    import ftrack_api._centralized_storage_scenario
ImportError: No module named _centralized_storage_scenario

It does not seem to have a "python" option, but "C" gives an okay result

 

Share this post


Link to post
Share on other sites

Sweet. That fixed it, thanks!

Of course now I have other stuff on my hands, but hope to play some more with ftrack-connect soon! :)

Quote

As for the code highlighting there is a button, "Code", that you can use to insert code into your posts:

Funnily enough when I was at home it didn't show the full editor but only two or three buttons, here it shows fine. Anyway, with the icons in the editor it makes much more sense seeing the code icon! Thanks anyway.

Share this post


Link to post
Share on other sites

Not sure if related so posting it in the same topic just in case.

The ftrack-connect launches fine. But whenever I try to access the widgets through python I'm getting No module named ftrack errors.

For example

import ftrack_connect.ui.widget.user

This will result in that error. Do I need to install an "ftrack" module separately?

Share this post


Link to post
Share on other sites

Actually. I'm also getting the No module named ftrack error when trying to log in with the window that pops up with `python -m ftrack_connect`.

So it still seems something is off with the install.

EDIT: Just tried installing again but it seems that no ftrack module gets installed. Is this an issue with 0.1.19? Or do I need to install that separately?

Hmm, even more interesting. When browsing that tag on bitbucket it doesn't have the `import ftrack` statement but when installing with `pip install` of that particular tag it does have that statement. It seems that pip install might be messing up somewhere.

EDIT2: Does anyone know the exact pip install line to run to install from a specific tag. Just adding `@0.1.19` doesn't seem to do what was needed. I seem to be unable to install this through pip install.

Share this post


Link to post
Share on other sites
2 hours ago, Mattias Lagergren said:

About the "No module named ftrack" issue; it is a bit hidden but as mentioned here http://ftrack-connect.rtd.ftrack.com/en/latest/installing.html#dependencies you need to donwload the ftrack api and make it available on the PYTHONPATH before launching ftrack connect. 

I had actually seen this, but I assumed the pip install also took this dependency along. But I'll download that separately and then it should work?

This is the command I was running from a .bat file in the installation directory:
 

pip install --target=%~dp0 git+https://bitbucket.org/ftrack/ftrack-connect.git@0.1.19

 

Share this post


Link to post
Share on other sites

Ok. I restarted the whole process with a clean slate and have it working now. The actual step for pip install that I took was:

pip install --target=C:/tmp/target git+https://bitbucket.org/ftrack/ftrack-connect.git@0.1.19#egg=ftrack_connect

After that I downloaded the API package from the ftrack server and added it to the PYTHONPATH.

I edited the ftrack.py file so it contained my API key and server URL and then launched ftrack connect with `python -m ftrack_connect` succesfully.

Sorry for the trouble!

Share this post


Link to post
Share on other sites

No worries at all! 

Quote

I had actually seen this, but I assumed the pip install also took this dependency along. But I'll download that separately and then it should work?

It does, but the legacy ftrack api does not exist as an installable in a public repository so we cannot have it as a real dependency. The new ftrack-python-api is public and is uploaded to pypi. But for the legacy one we still haven't got to that - it is however something we would like to fix!

Share this post


Link to post
Share on other sites

I'm running into the same "No module named ftrack" error.  I've manually installed the API from our ftrackapp site and added it to PYTHONPATH during launch like so:

FTRACK_API_LEGACY = 'path\to\ftrack_legacy_api'

if not FTRACK_API_LEGACY in sys.path:
	sys.path.append( FTRACK_API_LEGACY )

subprocess.Popen(['python', '-m', 'ftrack_connect'])

Here's a new post with more details and related questions: 

 

Share this post


Link to post
Share on other sites

It was called python-api.tar.  

I literally just finished up testing a solution that I found here here.  I'll update my post in the other thread with the code that worked.

 

Share this post


Link to post
Share on other sites

I'm starting a new basic project and did a fresh install of Python because I muddied up the default install when I first started getting into Ftrack.  I'm also starting to use a virtual env.  I'm having trouble getting my ftrack-connect submodule set up and built now.  Here's my repo for context: https://github.com/mikebourbeauart/ftrack-from-source

  1. I add the submodule to my repo like so:
# Open git bash at this dir: [root_dir]\modules\ftrack\connect
git submodule add https://borbs727@bitbucket.org/ftrack/ftrack-connect.git ftrack-connect

2.  Then I go to that path [root_dir]\modules\ftrack\connect\ftrack-connect, shift+right click and open a command window

3. Then I run:

python setup.py develop

I get an error after a while that I need to specify the cmake path with --cmake... I didn't have to do this in my other project.

4. I've also tried going to my venv, opening a command window at that path, and running:

pip install -e [root_path]\modules\ftrack\connect\ftrack-connect

I get the same error though.  

5. I've also tried this:

pip install -e git+https://bitbucket.org/ftrack/ftrack-connect.git@0.1.26#egg=ftrack_connect

Am I missing something on my local install of Python?

Here's a bit of the log, it seems to be related to PySide:

Searching for PySide<2,>=1.2.2
    Reading https://pypi.python.org/simple/PySide/
    Downloading https://pypi.python.org/packages/36/ac/ca31db6f2225844d37a41b106
15c3d371587677efd074db29855e7035de6/PySide-1.2.4.tar.gz#md5=3cb7174c13bd45e3e8f7
7638926cb8c0
    Best match: PySide 1.2.4
    Processing PySide-1.2.4.tar.gz
    Writing c:\users\mike~1.bou\appdata\local\temp\easy_install-2knbwp\PySide-1.
2.4\setup.cfg
    Running PySide-1.2.4\setup.py -q bdist_egg --dist-dir c:\users\mike~1.bou\ap
pdata\local\temp\easy_install-2knbwp\PySide-1.2.4\egg-dist-tmp-rxbhgh
    Removing c:\users\mike~1.bou\appdata\local\temp\easy_install-2knbwp\PySide-1
.2.4\pyside_package
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "D:\Git_Stuff\ftrack-from-source\mb_tests\mb_tests\venv\ftrack-api-en
v\src\ftrack-connect\setup.py", line 254, in <module>
        setup(**configuration)
      File "C:\Python27\lib\distutils\core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "C:\Python27\lib\site-packages\setuptools\dist.py", line 348, in __in
it__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "C:\Python27\lib\site-packages\setuptools\dist.py", line 394, in fetc
h_build_eggs
        replace_conflicting=True,
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 826,
in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1098,
 in best_match
        return self.obtain(req, installer)
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1110,
 in obtain
        return installer(requirement)
      File "C:\Python27\lib\site-packages\setuptools\dist.py", line 461, in fetc
h_build_egg
        return cmd.easy_install(req)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 664, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 694, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 875, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 1114, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", l
ine 1102, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: Failed to f
ind cmake. Please specify the path to cmake with --cmake parameter.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in D:\Git_Stuff\ftra
ck-from-source\mb_tests\mb_tests\venv\ftrack-api-env\src\ftrack-connect\

D:\Git_Stuff\ftrack-from-source\mb_tests\mb_tests\venv\ftrack-api-env>

D:\Git_Stuff\ftrack-from-source\mb_tests\mb_tests\venv\ftrack-api-env>

 

Share this post


Link to post
Share on other sites

I ended up installing and building it through the console:

  1. Open command prompt at [root_dir]\venvs\ftrack-api-env
  2. Activate the venv:
    1. [root_dir]\venv\ftrack-api-env\Scripts\activate
  3. Install the ftrack-connect package:
    1. pip install -e [root_dir]\modules\ftrack\connect\ftrack-connect
  4. Open command prompt at [root_dir]\modules\ftrack\connect\ftrack-connect
    1. python setup.py build

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