[Solved] tortoisehg fails to run after upgrade

Need help with C, C++, perl, python, etc?

[Solved] tortoisehg fails to run after upgrade

Postby ticketman » 2020-08-19 15:34

System:
Bullseye,
Code: Select all
5.7.0-2-amd64 #1 SMP Debian 5.7.10-1 (2020-07-26) x86_64 GNU/Linux


Tortoisehg downloaded from:
https://www.mercurial-scm.org/

error message when running thg:

Code: Select all
Traceback (most recent call last):
  File "./thg", line 52, in <module>
    from setup import build_ui
  File "~/DATA0/Software_Dev/TortoiseHg/thg new/setup.py", line 30, in <module>
    from i18n.msgfmt import Msgfmt
  File "~/DATA0/Software_Dev/TortoiseHg/thg new/i18n/msgfmt.py", line 39, in <module>
    from mercurial import (
ImportError: No module named mercurial


other config data:

Code: Select all
which python
/usr/bin/python

hg --version  gives
Mercurial Distributed SCM (version 5.4.1)

python --version  gives
Python 2.7.18

usr/bin/python  points to python2,  which points to python2.7

usr/bin/python3 points to python3.8

pyversions -i  gives
python2.7

Directories present / not present:
/usr/lib/python3/dist-packages/mercurial
/usr/lib/python2.7/dist-packages/  : no mercurial folder!
/usr/lib/python3.8/                         : no dist-packages folder!


I think the problem is that the system is running python 2.7 but the corresponding usr/lib/python2.7 folder does not have mercurial in it.
So I added this to my .bashrc:
Code: Select all
alias python='/usr/bin/python3'


But now python --version gives
Python 3.8.5
and the python 3.8 libs also don't have mercurial in them, and I get the same error.

How do I fix this?
Last edited by ticketman on 2020-09-19 17:57, edited 2 times in total.
ticketman
 
Posts: 99
Joined: 2012-06-30 11:06

Re: tortoisehg fails to run after upgrade

Postby Head_on_a_Stick » 2020-08-19 16:08

ticketman wrote:Bullseye

Why not just use the stable release instead? That has tortoisehg in the repositories.

ticketman wrote:
Code: Select all
ImportError: No module named mercurial

Code: Select all
# apt install mercurial
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12495
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: tortoisehg fails to run after upgrade

Postby ticketman » 2020-08-19 17:40

I'm using testing (for better or worse).
tortoisehg has lost its maintainer for both testing and experimental.
Anyway, I had been using tortoisehg from the download location quite successfully until now.

I do have mercurial (hg) installed :

hg --version gives
Mercurial Distributed SCM (version 5.4.1)

It also shows up in apt.

I think it's a lib issue - mercurial lib appears to be in the wrong place.
ticketman
 
Posts: 99
Joined: 2012-06-30 11:06

Re: tortoisehg fails to run after upgrade

Postby Head_on_a_Stick » 2020-08-19 17:51

ticketman wrote:I do have mercurial (hg) installed :

hg --version gives
Mercurial Distributed SCM (version 5.4.1)

It also shows up in apt

The version of mercurial in testing is 5.5, can we see
Code: Select all
apt policy mercurial
type hg
find /usr/lib/python3 -name mercurial
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12495
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: tortoisehg fails to run after upgrade

Postby ticketman » 2020-08-19 18:19

Hmm ... yesterday I did a sudo apt update and a sudo apt upgrade and after all was done the installed version of mercurial in apt says 5.4.1-3.
Do you think I should do a 'apt install mercurial' anyway?
Maybe the repos are still not properly up-to-date?
ticketman
 
Posts: 99
Joined: 2012-06-30 11:06

Re: tortoisehg fails to run after upgrade

Postby Head_on_a_Stick » 2020-08-19 18:30

ticketman wrote:Do you think I should do a 'apt install mercurial' anyway?

I think you should post my requested output.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12495
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: tortoisehg fails to run after upgrade

Postby ticketman » 2020-08-20 14:44

My apologies, I misread your last email.
I get:
Code: Select all
~$ apt policy mercurial
mercurial:
  Installed: 5.4.1-3
  Candidate: 5.4.1-3
  Version table:
 *** 5.4.1-3 500
        500 http://ftp.uk.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status

~$ type hg
hg is /usr/bin/hg

~$ find /usr/lib/python3 -name mercurial
/usr/lib/python3/dist-packages/mercurial


I then did another update cycle and noticed:
Code: Select all
Get:43 http://ftp.uk.debian.org/debian testing/main amd64 mercurial amd64 5.5-2 [351 kB]                                   
Get:44 http://ftp.uk.debian.org/debian testing/main amd64 mercurial-common all 5.5-2 [2,714 kB]   


I removed the alias in my .bashrc and tried running thg again - got the same error as before.
I re-ran your commands (no reboot), and the apt policy command now gives a different response:
Code: Select all
~$ apt policy mercurial
mercurial:
  Installed: 5.5-2
  Candidate: 5.5-2
  Version table:
 *** 5.5-2 500
        500 http://ftp.uk.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status

So I now have the correct version of mercurial installed, but still can't run thg.
The same usr/lib and usr/bin folders are present, i.e.

usr/bin/python points to python2, which points to python2.7
usr/bin/python3 points to python3.8
/usr/lib/python3/dist-packages/mercurial (there is no other file/folder under usr/lib/python3)
/usr/lib/python2.7/dist-packages/ : no mercurial folder!
/usr/lib/python3.8/ : no dist-packages folder!

Still seems to me that the usr/lib/python3/dist-packages folder should be in /usr/lib/python3.8/ ??
ticketman
 
Posts: 99
Joined: 2012-06-30 11:06

Re: tortoisehg fails to run after upgrade

Postby ticketman » 2020-09-19 17:56

Solved : I edited the first line in the script file 'thg'
from
Code: Select all
#!/usr/bin/env python

to
Code: Select all
#!/usr/bin/env python3


Also make sure you have the following packages installed: python3-distutils, python3-pyqt5, python3-pyqt5-qsci
ticketman
 
Posts: 99
Joined: 2012-06-30 11:06

Re: [Solved] tortoisehg fails to run after upgrade

Postby sunrat » 2020-09-19 22:46

In my sid system where python 2 has been deprecated and now removed, I symlinked /usr/bin/python to /usr/bin/python3 and it solved a couple of python applications from not starting. I've been waiting for any unintended consequences to raise their ugly heads but none so far. YMMV.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3193
Joined: 2006-08-29 09:12
Location: Melbourne, Australia


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable