Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not start meld on ubuntu 16.04 as error import meld.conf

Tags:

ubuntu

meld

I am using Ubuntu 16.04 with python version 3.5.2. The problem I am having is, I can't start meld. Every time I try to open it get the error message bellow:

Traceback (most recent call last):
File "/usr/bin/meld", line 73, in <module>
import meld.conf
ImportError: No module named 'meld'

Can anyone help please

Thanks

Fahim

like image 331
Fahim Avatar asked Jun 10 '18 12:06

Fahim


2 Answers

My guess would be that you have changed your system's default Python version (Python3 instead of Python2). Two possible solutions:

  • Switch back to Python2. You might not want to do this, as there probably was a reason for switching to Python3. Switching back might result in other programs not working as expected. See command update-alternatives for switching the default Python version.

  • Force meld to use Python2. For doing so, open /usr/bin/meld with root rights in a text editor and change the very first line from

    #!/usr/bin/python

    to

    #!/usr/bin/python2

Attention: Whenever meld gets updated, you will have to do that modification again.

like image 151
Guy Avatar answered Oct 13 '22 21:10

Guy


Meld as handled by apt package manager in 16.04 assumes that the system python is 2.7. So the python libraries needed are installed to /usr/lib/python2.7/dist-packages/meld. If your system is python is 3.5, it's not going to find the packages it needs.

Your options are:

  1. Put together a launch script to set python to python2.7 before calling meld

  2. Download the self-contained package from the website:

    wget https://download.gnome.org/sources/meld/3.18/meld-3.18.2.tar.xz tar -xvf meld-3.18.2.tar.xz cd meld-3.18.2/bin/ ./meld

like image 23
mcragun Avatar answered Oct 13 '22 21:10

mcragun