python3.7 installation failing - so why?

Chris Angelico rosuav at gmail.com
Sat Feb 23 14:16:01 EST 2019


On Sun, Feb 24, 2019 at 4:44 AM Terry Reedy <tjreedy at udel.edu> wrote:
>
> On 2/22/2019 10:56 PM, Chris Angelico wrote:
> > On Sat, Feb 23, 2019 at 2:51 PM Frank Miles <pedicularis at mail.com> wrote:
>
> >> Question: how can I determine what has gone wrong?
> >
> > Hmm. I'd start with:
> >
> > $ which python3
> > $ dpkg -S `which python3`
> >
> > and from inside Python:
> > >>> import sys; sys.path
>
> Adding ', sys.executable' is often handy and works on all systems with
> python.

True. Though I also was curious as to the package it came from (dpkg
-S will tell you "oh, that file was installed from package XYZ"), and
the OP did state that it was a Debian system ergo dpkg-managed. But
for general questions, absolutely, sys.executable is handy.

> > >>> import enum; enum.__file__
>
> I should remember to suggest this when an import runs but the imported
> module does not work right.
>

It's most often helpful when you get someone trying out regular
expressions by writing a test file called "re.py" or something. :)

ChrisA



More information about the Python-list mailing list