Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python issue with Mercurial
#1
'm using Windows 10 and have Cygwin and MobaXterm installed. I need to use Mercurial. It works fine from Cygwin but I want to run it from MobaXterm. I just installed Mercurial plugin for MobaXterm and it claimed that it should run with Python 2.7 In my case I have both Python 3 and Python 2. MobaXterm does not see Python 2. Here's my environment:
MobaXterm:
~/Desktop @ BOS-LTIRM181511
| => which hg
hg is aliased to `/bin/hg'
hg is /bin/hg
hg is /drives/c/MobaXterm/slash/bin/hg

________________________________________________________________________________
| ~/Desktop @ BOS-LTIRM181511
| => which python
python is aliased to `ToolNotIncluded python'

________________________________________________________________________________
| ~/Desktop @ BOS-LTIRM181511
| => which python3
python3 is /bin/python3
python3 is /drives/c/MobaXterm/slash/bin/python3

________________________________________________________________________________
| ~/Desktop @ BOS-LTIRM181511
| => /cygdrive/c/Python27/python --version
Python 2.7.15

________________________________________________________________________________
| ~/Desktop @ BOS-LTIRM181511
| =>
----
Cygwin:
$ hg --version
Mercurial Distributed SCM (version 5.0.2)
(see https://mercurial-scm.org for more information)

Copyright © 2005-2019 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

user@BOS-LTIRM181511 /usr/bin
$ which hg
hg is /usr/bin/hg
hg is /usr/bin/hg

user@BOS-LTIRM181511 /usr/bin
$ which python
python is /usr/bin/python
python is /cygdrive/c/Python27/python
python is /usr/bin/python

user@BOS-LTIRM181511 /usr/bin
$ which python3
-bash: type: python3: not found

user@BOS-LTIRM181511 /usr/bin
$ /cygdrive/c/Python27/python --version
Python 2.7.15
How could I fix it and make Mercurial run from MobaXterm?
P.S.
I created an alias to python and now from MobaXterm I could run: => python --version Python 2.7.15 But still I have the same error: => hg --version bash: /bin/hg: /bin/python: bad interpreter: No such file or directory Any help?
Thanks
Reply
#2
It won't help you much but I wouldn't use a plugin that requires Python 2.7 to run. The plugin could be an abandonware. It will bring you a lot of troubles without benefits. There must be a way to use Mercurial for your project without passing through the outdated plugin.
Reply
#3
I believe the new mercurial (5.7) is OK: https://www.mercurial-scm.org/
Reply
#4
That was great hint. I was able to install Mercurial 5.7 and now I don't have an issue to run it from MobaXterm.
At the same time I hit another issue which I don't have using Cygwin i.e. authentication problem.
For some reason I can't access repository from MobaXterm but it works fine from Cygwin:
=> hg pull http://10.9.214.102/path1/path2
pulling from http://10.9.214.102/path1/path2
abort: http authorization required for http://10.9.214.102/path1/path2
I tried to add [auth] section to hgrc but it didn't help.
Any clue?

Thanks
Reply
#5
try changing http to https
Reply
#6
Well ... change to https did not make a diff.
Not sure why it works fine on the same PC using Cygwin.
FYI: I am using Emacs as Cygwin package. When I use Emacs shell I also don't have problem to access the same repository.
Sounds like MobaXterm has some different user environment which is not recognized by Mercurial but valid for Cygwin.
Not sure ... what else to try

Thanks
Reply
#7
I use Linux, haven't used a MS product for several years, so rusty.
Perhaps it's time to think of git?
susja likes this post
Reply
#8
Sure thing,
It's just for fun ..
Thanks for the help anyway
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020