Mailing List Archive

Cannot install pkg_resources using pip
Python3-3.9.10 installed on this Slackware64-14.2 desktop. Trying to run
meson to build an application I'm told it's missing pkg_resources, which is
part of setuptools. The command fails:
# pip install setuptools
bash: /usr/bin/pip: /usr/bin/python3.7: bad interpreter: No such file or directory

There is no python3.7 here:
# ls /usr/bin/python3.7
ls: cannot access '/usr/bin/python3.7': No such file or directory

How do I clean this up?

TIA,

Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 4/16/2023 4:42 PM, Rich Shepard wrote:
> Python3-3.9.10 installed on this Slackware64-14.2 desktop. Trying to run
> meson to build an application I'm told it's missing pkg_resources, which is
> part of setuptools. The command fails:
> # pip install setuptools
> bash: /usr/bin/pip: /usr/bin/python3.7: bad interpreter: No such file or
> directory
>
> There is no python3.7 here:
> # ls /usr/bin/python3.7
> ls: cannot access '/usr/bin/python3.7': No such file or directory
>
> How do I clean this up?

What is there to clean up? If you have Python 3.9 installed, why are
you fooling around trying to run Python 3.7? It seems you are not
telling us something ...

It's better to always run pip with the version of Python that you intend
to use. If that is launched when you type "python3", then run pip this way:

python3 -m pip

If instead you want to use, say, python3.9, then type this:

python3.9 -m pip

--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On Sun, 16 Apr 2023, Thomas Passin wrote:

> It worked then because your path found a pip script. When there are more
> than one Python installations, it can be unclear which one will get run,
> depending on how the path got set up after the last version was installed.

Thomas,

I probably last used pip with a python-3.7 version.

> To check your version of Python, run
> python3 -V

$ python3 -V
Python 3.9.10

> Then try to run pip:
> python3.9 -m pip

$ python3.9 -m pip
/usr/bin/python3.9: No module named pip

> If pip has not been installed (very possible on Linux), then you will need to
> get it. If python3.9 is not the system-upgraded version, then do an internet
> search for "linux python install pip". There's a pip website that has an
> installer for it. I never remember what it's called, so I always have to
> search for it myself.

https://www.redhat.com/sysadmin/install-python-pip-linux

I'll download the installer from ther.

> If it appears that python3.9 *is* the version installed by the system, then
> use the system installer to install the right version of pip - as I said
> above, the package name can vary across distros.

It should have been installed with the upgrade to 3.9.10

> Your message doesn't seem to have been copied to the mailing list. If you
> don't mind, it could help other people if you copied it and this reply to
> the list.

I always respond to the mail list if that's the 'reply to' address.
Sometimes I don't check the address used in my reply, assuming it's correct.

Thanks,

Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On Sun, 16 Apr 2023, Rich Shepard wrote:

> I'll download the installer from there.

But, I still cannot install the pkg_resources module that meson wants to
start the build of pulseaudio-equalizer:
# pip install pkg_resources
ERROR: Could not find a version that satisfies the requirement pkg_resources (from versions: none)
ERROR: No matching distribution found for pkg_resources

Rich

--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 4/16/2023 6:27 PM, Rich Shepard wrote:
> On Sun, 16 Apr 2023, Thomas Passin wrote:
[snip]


> It should have been installed with the upgrade to 3.9.10

In my experience, on Windows pip is always included but on Linux hardly
ever. I have always needed to install the system installer pip package
or get it from the pip site, depending, as I wrote earlier, on whether
your version of Python was installed by the system or not.

[.I'm no great Linux expert but I've had to go through this for probably
a dozen VMs over the last few years].
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 4/16/2023 6:34 PM, Rich Shepard wrote:
> On Sun, 16 Apr 2023, Rich Shepard wrote:
>
>> I'll download the installer from there.
>
> But, I still cannot install the pkg_resources module that meson wants to
> start the build of pulseaudio-equalizer:
> # pip install pkg_resources
> ERROR: Could not find a version that satisfies the requirement
> pkg_resources (from versions: none)
> ERROR: No matching distribution found for pkg_resources
>
> Rich


Sorry, Rich, I've never dealt with this so someone else will have to
give suggestions.

I would try to see if there are any versions available. It could be
that meson says it needs version x but only version y > x is available.
Pip will quit but meson may very well work with the available version
anyway. So I would try to install pkg_resources on its own, and then
see if the meson build can succeed. No guarantees, but I've seen this
work before. So

python3.9 -m pip install --user pkg_resources

Or, to see what versions if any are available:

python3.9 -m pip install --user pkg_resources==
# NO spaces allowed before the "==".

There is a pip option to ignore the version specification and just leave
the existing package installed as is, and this could help if the full
installation wants to downgrade the pgk_resources that you just installed.

You can also use the --dry-run option to see what would happen without
actually changing anything.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 4/16/2023 6:27 PM, Rich Shepard wrote:
>> If pip has not been installed (very possible on Linux), then you will
>> need to get it.  If python3.9 is not the system-upgraded version, then
>> do an internet search for "linux python install pip". There's a pip
>> website that has an installer for it. I never remember what it's
>> called, so I always have to search for it myself.
>
> https://www.redhat.com/sysadmin/install-python-pip-linux
>
> I'll download the installer from ther.

The page I was thinking of is

https://pip.pypa.io/en/stable/installation/

I found it by an internet search for "pip installer". It covers several
ways to install pip on Linux, MacOS, and Windows. On Linux, use it for
Python installations that were *not* installed by the system. Use the
package manager if the Python installation or upgrade *was* installed by
the system.

That Redhat link basically uses the pypa.io instructions.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On Sun, 16 Apr 2023, Thomas Passin wrote:

> Sorry, Rich, I've never dealt with this so someone else will have to give
> suggestions.

Thomas,

This is all new to me, too.

> I would try to see if there are any versions available. It could be that
> meson says it needs version x but only version y > x is available. Pip
> will quit but meson may very well work with the available version anyway.
> So I would try to install pkg_resources on its own, and then see if the
> meson build can succeed. No guarantees, but I've seen this work before. So
> python3.9 -m pip install --user pkg_resources
>
> Or, to see what versions if any are available:
> python3.9 -m pip install --user pkg_resources==
> # NO spaces allowed before the "==".

Thank you. I'll give this a try.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 4/17/23 08:45, Rich Shepard wrote:
> On Sun, 16 Apr 2023, Thomas Passin wrote:

Slackware isn't as straight forward in it's management as other distros
(not standardized anyway). If this is someone elses install I would be
cautious in using any advice I am providing, as it would be better for
someone with familiarity with how they want the device set up to address
the issues (such as if they prefer using some sort of package scheme or
if doing everything from source is ok).

That being said, if you start from python source (as in overwriting what
is currently there and doing a fresh reinstall), you can download
Python3.9, then run
./configure
make
make install

after doing that, verify (python may still link to something old, that
may be ok in this case, but good to note)
python --version
python3 --version
python3.9 --version

pkg_resources is inside of setuptools

so you would run
python3.9 -m pip install setuptools
(might already be there with the reinstall)

after that run
python3.9

then run
import pkg_resources
import setuptools
to see if you get errors or successful imports

if they import successfully, attempt to reinstall meson and ninja
against your fresh python install
python3.9 -m pip install meson
python3.9 -m pip install ninja

verify versions with
meson -v
ninja --version

Then follow the instructions of the meson package from there (you
mentioned some sort of pulseaudio-equalizer, depending on your desktop
environment, you may run in to additional issues depending on how your
slackware is setup).

--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [RESOLVED] [ In reply to ]
On Sun, 16 Apr 2023, Rich Shepard wrote:

> How do I clean this up?

My thanks for the suggestions and ideas you sent me on this issue. I've
resolved it by not trying to build pulseaudio-equalizer. I don't need it
because I learned this morning that my Yamaha CM500 headset clearly heard
the Zoom audio test tones and voices on a YouTube video.

I'm testing the headset on a Zoom call this afternoon with a friend.
Assuming it works with the meeting as it did on the Zoom test I'll use it
for Zoom and Jitsi meetings and use the Marantz Pro mic and Panasonic
headphones for recording web tutorials and podcasts.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On Mon, 17 Apr 2023, aapost wrote:

> Slackware isn't as straight forward in it's management as other distros
> (not standardized anyway).

I've used Slackware for 20 years; it's completely rationale and comfortable
for me. :-)

> That being said, if you start from python source ...

If worse came to worse, I'd reinstall the distro package.

Thanks,

Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: Cannot install pkg_resources using pip [ In reply to ]
On 2023-04-16 17:03:43 -0400, Thomas Passin wrote:
> On 4/16/2023 4:42 PM, Rich Shepard wrote:
> > Python3-3.9.10 installed on this Slackware64-14.2 desktop.
[...]
> > # pip install setuptools
> > bash: /usr/bin/pip: /usr/bin/python3.7: bad interpreter: No such file or
> > directory
> >
> > There is no python3.7 here:
> > # ls /usr/bin/python3.7
> > ls: cannot access '/usr/bin/python3.7': No such file or directory
> >
> > How do I clean this up?
>
> What is there to clean up?

There is a version of pip installed for a version of python which isn't
installed. That's definitely not useful, so it should be cleaned up.

As to how to do that:

Find out which package /usr/bin/pip belongs to and deinstall or upgrade
this package. How to find that package is a Slackware question, not a
Python question. And since Rich wrote that he's been comfortably using
Slackware for 20 years, I'll trust that he knows how to do that and just
needed a little nudge into the right direction.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"