Jump to: Board index » General » Fusion

Python problem on Ubuntu Linux

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Dan Bethell

  • Posts: 5
  • Joined: Tue Nov 14, 2017 6:06 pm

Python problem on Ubuntu Linux

PostFri Feb 02, 2018 10:17 pm

Hi,

Has anyone managed to get Fusion installed and Python working on a flavour of Ubuntu Linux?

Both pythons are installed on my system...
Code: Select all
$ python
Python 2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Code: Select all
$ python3
Python 3.6.3 (default, Oct  3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Heck, the Fusion installer even tells me it's found them...
Fusion_PythonInstallProblem.png
Fusion_PythonInstallProblem.png (68.49 KiB) Viewed 1150 times

Fusion runs just fine, but when I flip to the Py2 or Py3 Console tab I get an error popup saying 'Python 2.7 not found.' and a similar message for 3.6.
Fusion_PythonInstallProblem2.png
Fusion_PythonInstallProblem2.png (14.96 KiB) Viewed 1150 times


I'm running Fusion 9.0.2 and vanilla Ubuntu 17.10 (although found the same problem with 16.04). As far as I can tell the Python installation on this distro is pretty standard - do i need to set a PYTHONPATH or somesuch for Fusion to pick up Python at runtime?

Any help, much appreciated.
Dan
Offline

Abdelrahman Magdy

  • Posts: 252
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Python problem on Ubuntu Linux

PostMon Feb 05, 2018 10:12 pm

I have tried to get it working, but I failed entirely.. had to move to CentOS mainly because of that, as Blackmagic insisted they don't support any other Linux distro. But keep in mind, on CentOS, I only managed to get Python2.7 to work. I am no where near doing the same with Python3, and the Blackmagic support have been totally clueless about this problem. In Fusion, it says that it needs Python3.6, but their support says that I need Python3.3. I have installed both, and I still couldn't get any of them to work.
System specs:
Resolve Studio version: 15.0.0.086
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline

gunk0001

  • Posts: 2
  • Joined: Sat Mar 10, 2018 6:52 am
  • Real Name: Mohammed Issa

Re: Python problem on Ubuntu Linux

PostMon May 21, 2018 5:35 am

not really concern on python3 since python2.7 is still vfx standard.
Offline

Abdelrahman Magdy

  • Posts: 252
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Python problem on Ubuntu Linux

PostTue May 29, 2018 4:32 pm

gunk0001 wrote:not really concern on python3 since python2.7 is still vfx standard.

Actually, the transition to Python 3 is about to start. According to the VFX Reference Platform, software vendors are encouraged to start releasing tech review versions of their programs with Python 3 support, as the transition is going to happen in 2020.

So, it is not a bad time to start dipping your toe into Python 3. But as I said, 2.7 is working for me on Windows and CentOS, but not on Linux Mint when I last tried it.
System specs:
Resolve Studio version: 15.0.0.086
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline

Jimmy Christensen

  • Posts: 2
  • Joined: Fri May 20, 2016 9:02 pm

Re: Python problem on Ubuntu Linux

PostWed Aug 15, 2018 11:11 am

I think I found out why it doesn't work in Ubuntu

First it looks for "libpython2.7.so" with `ldconfig -p`

It finds it in "/usr/lib/x86_64-linux-gnu" and then assumes that all the modules are located in "/usr/lib/x86_64-linux-gnu/python2.7" which is not the case as this is in "/usr/lib/python2.7".

If you link "/usr/lib/python2.7" to "/usr/lib/x86_64-linux-gnu/python2.7" it then has some more assumptions and tries to find the python2.7 directory in "/usr/lib/lib"
Offline

Dan Bethell

  • Posts: 5
  • Joined: Tue Nov 14, 2017 6:06 pm

Re: Python problem on Ubuntu Linux

PostSun Sep 16, 2018 11:13 am

Jimmy, that's really useful information! How on earth did you manage to work out/debug what Fusion was doing under the hood??

Using that info I finally managed to get Python2.7 working in Fusion 9 on Ubuntu 18.04. Rather than linking the python module directory (as apparently Fusion assumes everything is relative to the library itself) I sym-linked the shared library instead.
Code: Select all
% sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/
Then I added /usr/lib before any other paths in /etc/ld.so.conf.d/x86_64-linux-gnu.conf. After refreshing the ldconfig cache the new sym-linked python shared library appears in /usr/lib.
Code: Select all
% cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf
# Multiarch support
/usr/lib
/usr/local/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

% sudo ldconfig

% ldconfig -p | grep python2.7
   libpython2.7.so.1.0 (libc6,x86-64) => /usr/lib/libpython2.7.so.1.0
   libpython2.7.so.1.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
   libpython2.7.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpython2.7.so
Now when I run Fusion the Py2 console gives me no errors and evaluates exactly as I'd expect!
fusion_python_ubuntu.png
fusion_python_ubuntu.png (28.31 KiB) Viewed 615 times

I still haven't had any luck getting Python3 to work using this solution though, so any more insight into debugging Fusions relationship with Python3 would be great!
Offline

Chris Wells

  • Posts: 59
  • Joined: Mon Nov 10, 2014 11:25 pm

Re: Python problem on Ubuntu Linux

PostWed Sep 19, 2018 7:59 pm

Dan, That is super helpful! Thanks so much for posting this. I now have python working on ubuntu :)

So has anyone had any luck talking to fusion from the outside world, the old import BlackmagicFusion doesn't work, But I have not idea where that module actually ended up or where to put it to make it work,

Anyone have any ideas?

Thanks
Chris
Offline

Dan Bethell

  • Posts: 5
  • Joined: Tue Nov 14, 2017 6:06 pm

Re: Python problem on Ubuntu Linux

PostWed Sep 19, 2018 8:52 pm

Ah ok, I left that bit of information out. On installation Fusion will try to install (or rather, symlink) the BlackmagicFusion.py into /usr/lib/python2.7/site-packages, which does not exist by default on Ubuntu (it's called dist-packages instead). The installer doesn't error though, which is not ideal.

There are several ways to get the Blackmagic module into your path but probably the simplest is to mimic what the installer was trying to do...
Code: Select all
sudo ln -s /opt/BlackmagicDesign/Fusion9/BlackmagicFusion.py /usr/lib/python2.7/dist-packages/
That should get import BlackmagicFusion working as expected.
Offline

Chris Wells

  • Posts: 59
  • Joined: Mon Nov 10, 2014 11:25 pm

Re: Python problem on Ubuntu Linux

PostWed Sep 19, 2018 8:55 pm

Thanks Dan All up and working,
Offline
User avatar

MikeRochefort

  • Posts: 98
  • Joined: Thu Feb 12, 2015 2:48 am
  • Location: New England

Re: Python problem on Ubuntu Linux

PostFri Sep 21, 2018 6:31 am

I figured out Python 3.6 on CentOS. You'll need Python from IUS (python36u) or EPEL (python36) installed:

Code: Select all
cd /lib64
sudo ln -s libpython3.6m.so libpython3.6.so
sudo ldconfig


It's the `m` that's throwing it off. After doing so I can switch to Python 3.6 in the preferences just fine.

Cheers,
Mike
https://michaelrochefort.com/
3D Lookdev, Compositing, and Sysadmin
Fusion Studio 9.0.2
DaVinci Resolve Studio 15.1.0.25
CentOS 7.5.1804 | Intel i7-6850K | 32GB memory | 3x GTX 1070 | 390.87
Offline

Abdelrahman Magdy

  • Posts: 252
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Python problem on Ubuntu Linux

PostFri Sep 21, 2018 10:32 am

MikeRochefort wrote:I figured out Python 3.6 on CentOS. You'll need Python from IUS (python36u) or EPEL (python36) installed:

Code: Select all
cd /lib64
sudo ln -s libpython3.6m.so libpython3.6.so
sudo ldconfig


It's the `m` that's throwing it off. After doing so I can switch to Python 3.6 in the preferences just fine.

Cheers,
Mike

Is there a way to use it with the regular python installation (from python.org). I already have it installed with multiple things using it and I don't want go through the pain of re-doing this stuff?

Any ideas?
System specs:
Resolve Studio version: 15.0.0.086
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline
User avatar

MikeRochefort

  • Posts: 98
  • Joined: Thu Feb 12, 2015 2:48 am
  • Location: New England

Re: Python problem on Ubuntu Linux

PostFri Sep 21, 2018 1:15 pm

So youbuilt from source? Did you build to /usr/local or some custom path? As long as your python library is on the library search path, just creating a symlink with the incorrect “appropriate” naming will open things up. No need to change anything.

I sent an email to support about this, so they definitely have something to look at.

Cheers,
Mike
https://michaelrochefort.com/
3D Lookdev, Compositing, and Sysadmin
Fusion Studio 9.0.2
DaVinci Resolve Studio 15.1.0.25
CentOS 7.5.1804 | Intel i7-6850K | 32GB memory | 3x GTX 1070 | 390.87
Offline

Abdelrahman Magdy

  • Posts: 252
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Python problem on Ubuntu Linux

PostFri Sep 21, 2018 1:49 pm

MikeRochefort wrote:So youbuilt from source? Did you build to /usr/local or some custom path? As long as your python library is on the library search path, just creating a symlink with the incorrect “appropriate” naming will open things up. No need to change anything.
I built in /usr, so the python executable is in /usr/bin. I have both /usr/lib and /usr/lib64 on the library path.
Code: Select all
> echo $LD_LIBRARY_PATH
/usr/lib /usr/lib64 /usr/lib /usr/lib64
I also have libpython3.6.so in both of them.
Code: Select all
> ll /usr/lib | grep libpython
-r-xr-xr-x.  1 root root  21M Oct 25  2017 libpython3.6m.a
lrwxrwxrwx.  1 root root   20 Mar 17  2018 libpython3.6m.so -> libpython3.6m.so.1.0
-r-xr-xr-x.  1 root root  12M Mar 17  2018 libpython3.6m.so.1.0
lrwxrwxrwx.  1 root root   20 Sep 21 11:29 libpython3.6.so -> libpython3.6m.so.1.0
-r-xr-xr-x.  1 root root 7.6K Mar 17  2018 libpython3.so
Code: Select all
> ll /usr/lib64/ | grep libpython
lrwxrwxrwx.  1 root root     19 Aug  8 03:06 libpython2.7.so -> libpython2.7.so.1.0
-rwxr-xr-x.  1 root root   1.8M Jul 13 14:07 libpython2.7.so.1.0
lrwxrwxrwx.  1 root root     15 Sep 21 11:21 libpython3.6m.so.1.0 -> libpython3.6.so
lrwxrwxrwx.  1 root root     29 Sep 21 11:20 libpython3.6.so -> /usr/lib/libpython3.6m.so.1.0
lrwxrwxrwx.  1 root root     13 Sep 21 11:27 libpython3.so -> libpython3.so
However, I still can't get Python3 to work inside Fusion.
System specs:
Resolve Studio version: 15.0.0.086
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline
User avatar

MikeRochefort

  • Posts: 98
  • Joined: Thu Feb 12, 2015 2:48 am
  • Location: New England

Re: Python problem on Ubuntu Linux

PostFri Sep 21, 2018 8:05 pm

Can you run `sudo ldconfig` and see what happens?

Cheers,
Mike
https://michaelrochefort.com/
3D Lookdev, Compositing, and Sysadmin
Fusion Studio 9.0.2
DaVinci Resolve Studio 15.1.0.25
CentOS 7.5.1804 | Intel i7-6850K | 32GB memory | 3x GTX 1070 | 390.87
Offline

Abdelrahman Magdy

  • Posts: 252
  • Joined: Fri Jan 23, 2015 10:08 pm

Re: Python problem on Ubuntu Linux

PostSat Sep 22, 2018 1:15 am

MikeRochefort wrote:Can you run `sudo ldconfig` and see what happens?

Cheers,
Mike
Done it, and still nothing, unfortunately :(
System specs:
Resolve Studio version: 15.0.0.086
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB
Offline

limeforce

  • Posts: 1
  • Joined: Fri Oct 05, 2018 7:28 pm
  • Real Name: Emil Lindfors

Re: Python problem on Ubuntu Linux

PostFri Oct 05, 2018 7:45 pm

Thanks for the info Jimmy & Dan! The following worked for me on Linux Mint 18.3.

Add "/usr/lib" to the start of /etc/ld.so.conf.d/x86_64-linux-gnu.conf using:
Code: Select all
sudo vim /etc/ld.so.conf.d/x86_64-linux-gnu.conf
Then symlink the python lib to /usr/lib and refresh config:
Code: Select all
sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/x86_64-linux-gnu/libpython2.7.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so /usr/lib/

sudo ldconfig
That's all!

If you want to check your result against mine:
Code: Select all
~ $ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf
# Multiarch support
/usr/lib
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
~ $ sudo ldconfig -p |grep python2
libpython2.7.so.1.0 (libc6,x86-64) => /usr/lib/libpython2.7.so.1.0
libpython2.7.so.1.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
libpython2.7.so (libc6,x86-64) => /usr/lib/libpython2.7.so
libpython2.7.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpython2.7.so
libpyglib-2.0-python2.7.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpyglib-2.0-python2.7.so.0
Note that this only works for Python 2. Also, for a while I was trying another solution at the same time and it was actually preventing this one from working. I had set the environment variables FUSION_PYTHON27_HOME and FUSION_PYTHON36_HOME, as described in this thread:
Code: Select all
http://www.steakunderwater.com/wesuckless/viewtopic.php?f=16&t=1634&p=19796
I had to remove those.

P.S. LOL @ not being able to link to elsewhere on the web in 2018, Blackmagic pls.
Offline

Seth Goldin

  • Posts: 360
  • Joined: Wed Nov 04, 2015 7:43 pm

Re: Python problem on Ubuntu Linux

PostThu Nov 15, 2018 2:28 am

MikeRochefort wrote:I figured out Python 3.6 on CentOS. You'll need Python from IUS (python36u) or EPEL (python36) installed:

Code: Select all
cd /lib64
sudo ln -s libpython3.6m.so libpython3.6.so
sudo ldconfig


It's the `m` that's throwing it off. After doing so I can switch to Python 3.6 in the preferences just fine.

Still pretty confused here on BMD's CentOS 7.3 for 15.2 Studio.

2.7 came preinstalled, works fine inside Resolve's Console, and works in the shell:
Code: Select all
$ python2 -V
Python 2.7.5

So, I downloaded and installed 3.6 via IUS.

When I look in /usr/lib64, I see:
Code: Select all
$ cd /lib64
$ ls | grep python
libpyglib-2.0-python.so.0.0.0
libpython2.7.so.1.0
libpython3.6m.so.1.0
python2.7
python3.6

So, I create the link from libpython3.6m.so.1.0 to libpython3.6.so.1.0:
Code: Select all
$ sudo ln -s libpython3.6m.so.1.0 libpython3.6.so.1.0
$ sudo ldconfig

I also made sure to set my environmental variables manually to /usr/bin/python2.7 and /usr/bin/python3.6 by modifying the ~/.profile file, logging out, and logging back in again:
Code: Select all
$ printenv | grep python
PYTHONPATH=/usr/bin/python2.7:/opt/resolve/Developer/Scripting//Modules/:/usr/bin/python3.6

When I check to make sure that Python 3.6 is installed, just in Terminal, outside Resolve, I see:
Code: Select all
$ python3 -V
Python 3.6.6

However, Resolve Studio 15.2 is still only seeing Python 2! When I try to access Python 3 in the Console window, it tells me 3.6 isn't installed!

Where am I going wrong? I'm wondering if the IUS installation of 3.6.6 wasn't quite right, but now I'm not even sure how to uninstall that and try again...
DaVinci Resolve Studio 15.2.0.033
CentOS Linux 7.3 [Blackmagic Design custom ISO]
Windows 10 Pro 1803 17134.376
HP Z8 G4
1x Intel® Xeon® Gold 6136
48 GB (6x8 GB) DDR4-2666 ECC Registered RAM
1x GeForce GTX 1080 Ti

Return to Fusion

Who is online

Users browsing this forum: Kel Philm, Tomek Kosiorek and 2 guests