ubuntu16.04 meld and installation problems

This link: https: //blog.csdn.net/ai_liuliu/article/details/95504095
mounted meld
the sudo APT-GET meld the install
starts meld
1, a terminal command: meld &

Method 2, search MELD, FIG.

 

启动错误:
  File "/usr/bin/meld", line 73, in <module>
    import meld.conf
ModuleNotFoundError: No module named 'meld'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

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

After a series of search, finally found a Python version of the problem, meld need Python2 environment. Because previous studies Python, Python version to upgrade to 3.6.8, eventually leading to meld not working.
Solution:
find problems, we must solve the problem.

1.

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.

Go usr / bin directory below the python into a soft link of python2

2.

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

 

Go usr / bin directory, the file with a 2 beginning meld with python2 displayed on OK

There are more than two options, personally prefer the second. Although follow-up if the update meld would be more trouble, need to be reset, but will not affect the Python version of the system itself, but also to avoid causing more maddening problem.

After modifying the boot meld again, great service to rely on, then you can compare the code. Figure:

 

 

 

Some brief summary, please include a lot.

Thanks https://blog.csdn.net/yang332233/article/details/89084481

Guess you like

Origin www.cnblogs.com/Ph-one/p/12007090.html