Mercurial error: No module named HTMLParser

Pete Brunet peter.brunet at oracle.com
Sat Jun 16 20:27:29 UTC 2012


Thanks for the feedback Tim.

On 6/16/12 12:32 PM, Tim Bell wrote:
> On 06/16/12 09:36, Pete Brunet wrote:
>> When using hg commands I always get:
>>
>> *** failed to import extension defpath from
>> C:\Users\Pete\hg-extensions\defpath\defpath.py: No module named
>> HTMLParser
>>
>> I am using cygwin 1.7.0 (instead of the latest due to needing to run on
>> Windows 7).
>
> Did this hg and python come with your Cygwin install?
Python was not installed with cygwin, but I just did that.  which/where
indicate python is now running from the cygwin tree.  (I checked that
after changing ~/.hgrc to use cygwin style paths and removing some
environment variables as described below.)  The error changed from No
module named HTMLParser to No such file or directory for defpath.py and
jcheck.py.  However, ls shows that those file are there.
>
> Cygwin-aware programs expect Cygwin style paths, with /cygdrive/...
> and ':' separating the elements of a search path.
I changed ~/.hgrc to the cygwin style paths but that didn't help.
>
>> I tried adding the following to my environment variables but that didn't
>> help.  which/where indicates python is at this location.
>> PYTHONHOME=C:\Program Files\Python27
>> PYTHONPATH=C:\Program Files\Python27;C:\Program Files\Python27\Lib
>
> This is what a traditional Windows program would expect, but Cygwin
> programs won't understand the ':' and '\' characters
I removed PYTHONHOME and PYTHONPATH from my system env vars (I've never
needed them in the path) but that didn't help.  (I also removed it from
my PATH.)
>
>> If I type:
>> python /cygdrive/c/Users/Pete/hg-extensions/defpath/defpath.py
>> I get
>> python.exe: can't open file
>> '/cygdrive/c/Users/Pete/hg-extensions/defpath/defpath.py' [Errno 2] No
>> such file or directory
>
> What happens when you run the Windows equivalent command line:
>
>   python c:/Users/Pete/hg-extensions/defpath/defpath.py
>From c:\Users\Pete and typing <path to Win python>\python <path to
defpath>\defpath.py gives

ImportError: No module named mercurial.
>
>
>> If I type
>> ll /cygdrive/c/Users/Pete/hg-extensions/defpath/defpath.py
>> that file is there (and the rights are 700).
>>
>> If I use python -v I see lots of "can't create" messages.
>
> During what?  An 'hg clone' operation, or something else?.  Can't
> create output files, or .pyc files, or what files where?
python -v ...\defpath.py
>
>> cygwin "as administrator" I don't see the "can't create" messages when
>> using python -v but I still get the Errno 2 failure.  Also running hg
>> within an "as adminstrator" cygwin doesn't help.
>>
>> Does anyone have any ideas?
>
> Does your windows login have 'Administrator' privileges?  If not, you
> probably want to grant yourself 'Administrator' before proceeding.
It's Win 7 so even an Admin doesn't really have admin privileges, but
typically when I start my cygwin sessions I don't run them as "as
administrator".  This has worked in the past.

Note that I was off doing JavaFX work for a while and when I came back
to work on 7udev I forgot about needing cygwin 1.7.0 for builds so I
installed 1.7.15 (latest) and other than build I had no problems.  In
order to get my build to work I renamed my old 1.7.0 cygwin tree to
cygwin and then the build worked, but now mercurial isn't work for me as
described in my posts of today.  Maybe I need to use cygwin 1.7.0 for
builds and 1.7.15 for everything else.
>
> Hope this helps-
>
> Tim
>



More information about the build-dev mailing list