From: Russell VT <russellvt@gmail.com>
To: Achim Gratz <stromeko@nexgo.de>
Cc: cygwin@cygwin.com
Subject: Re: python3.9 failing?
Date: Wed, 22 Dec 2021 22:50:14 -0700 [thread overview]
Message-ID: <CANV2+nWPJE83rryNzJwwVNsKYbzvJnKV9GZ93ERzD95Zpb7QJg@mail.gmail.com> (raw)
In-Reply-To: <87k0fykrqm.fsf@Rainer.invalid>
On Tue, Dec 21, 2021 at 6:34 AM Achim Gratz <Stromeko@nexgo.de> wrote:
> Marco Atzeri writes:
> > Without Python 3.9 installed python3 should link by default to the
> > next in the line (likely 3.8)
>
> While python3 still defaults to python38 alternatives should probably
> prioritize 38 over 39?
That's how I "fixed" mercurial on my own installation, as it was
complaining about missing the "parsers" module, from inside the Python 3.9
libraries, IIRC.
$ /usr/sbin/alternatives.exe --display python
python - status is manual.
link currently points to /usr/bin/python3.8
/usr/bin/python2.7 - priority 27
/usr/bin/python3.8 - priority 38
/usr/bin/python3.6 - priority 36
/usr/bin/python3.7 - priority 37
/usr/bin/python3.9 - priority 39
Current `best' version is /usr/bin/python3.9.
Actually, switching back the alternative to "python3" is enough to
demonstrate it ... and I update my Cygwin packages fairly religiously
(probably at least every week or two). Though, looking at this, now... it
seems this now says "Python 3.8" (which works) but I'm 99% sure this was
complaining about Python 3.9, earlier.
So, maybe there's some weird race condition with what *.pyc or __pycache__
files are being built, and when? (ie. if the current user can write to the
cygwin directories, Python may have built the "wrong" versions of those
files for the "current" distribution that's now installed?)
Stack dump, below... after I had switched from a force-reinstall on Python
3.9 and Mercurial, to a Python 3,8 alternative, and back (using the
alternatives command).
Cheers -
Russell
$ hg status
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 69, in
_importfrom
fakelocals[modname] = mod = getattr(pkg, modname)
File "/usr/lib/python3.8/site-packages/mercurial/pycompat.py", line 303,
in w
return f(object, sysstr(name), *args)
AttributeError: module 'mercurial.cext' has no attribute 'parsers'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/hg", line 59, in <module>
dispatch.run()
File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
self.__spec__.loader.exec_module(self)
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in
_call_with_frames_removed
File "/usr/lib/python3.8/site-packages/mercurial/dispatch.py", line 21,
in <module>
from .i18n import _
File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
self.__spec__.loader.exec_module(self)
File "/usr/lib/python3.8/site-packages/mercurial/i18n.py", line 123, in
<module>
if _plain():
File "/usr/lib/python3.8/site-packages/mercurial/i18n.py", line 115, in
_plain
b'HGPLAIN' not in encoding.environ
File "/usr/lib/python3.9/importlib/util.py", line 245, in __getattribute__
self.__spec__.loader.exec_module(self)
File "/usr/lib/python3.8/site-packages/mercurial/encoding.py", line 40,
in <module>
charencode = policy.importmod('charencode')
File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 116, in
importmod
mod = _importfrom(pn, mn)
File "/usr/lib/python3.8/site-packages/mercurial/policy.py", line 71, in
_importfrom
raise ImportError('cannot import name %s' % modname)
ImportError: cannot import name parsers
--
Russell M. Van Tassell <russellvt@gmail.com>
next prev parent reply other threads:[~2021-12-23 5:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 13:12 Henry S. Thompson
2021-12-21 13:26 ` Marco Atzeri
2021-12-21 13:33 ` Achim Gratz
2021-12-23 5:50 ` Russell VT [this message]
2021-12-23 7:52 ` Marco Atzeri
2021-12-23 8:28 ` Russell VT
2021-12-23 8:50 ` Marco Atzeri
2021-12-23 20:00 ` Henry S. Thompson
2021-12-21 13:36 ` Marco Atzeri
2021-12-21 18:10 ` Henry S. Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANV2+nWPJE83rryNzJwwVNsKYbzvJnKV9GZ93ERzD95Zpb7QJg@mail.gmail.com \
--to=russellvt@gmail.com \
--cc=cygwin@cygwin.com \
--cc=stromeko@nexgo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).