1

OS: Raspbian 10; Python version: 3.8; Pip Version: 20.2.2

I have tried all solutions including the links in this post and still not able to find the solution for a raspbian environment. I am trying to perform pip3 install --no-cache-dir pytest and it gives be the error above. Are there any specific solutions to raspbian or linux environment?

Below is the pip install --no-cache-dir pytest -vvv output. I have highlighted the error (located in the middle) below.

Fetching project page and analyzing links: https://www.piwheels.org/simple/attrs/ Getting page https://www.piwheels.org/simple/attrs/ Found index url https://www.piwheels.org/simple https://www.piwheels.org:443 "GET /simple/attrs/ HTTP/1.1" 200 962 Found link https://www.piwheels.org/simple/attrs/attrs-19.3.0-py2.py3-none-any.whl#sha256=08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c (from https://www.piwheels.org/simple/attrs/), version: 19.3.0 Found link https://www.piwheels.org/simple/attrs/attrs-19.2.0-py2.py3-none-any.whl#sha256=ec20e7a4825331c1b5ebf261d111e16fa9612c1f7a5e1f884f12bd53a664dfd2 (from https://www.piwheels.org/simple/attrs/), version: 19.2.0 Found link https://www.piwheels.org/simple/attrs/attrs-19.1.0-py2.py3-none-any.whl#sha256=69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79 (from https://www.piwheels.org/simple/attrs/), version: 19.1.0 Found link https://www.piwheels.org/simple/attrs/attrs-18.2.0-py2.py3-none-any.whl#sha256=ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb (from https://www.piwheels.org/simple/attrs/), version: 18.2.0 Found link https://www.piwheels.org/simple/attrs/attrs-18.1.0-py2.py3-none-any.whl#sha256=4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265 (from https://www.piwheels.org/simple/attrs/), version: 18.1.0 Found link https://www.piwheels.org/simple/attrs/attrs-17.4.0-py2.py3-none-any.whl#sha256=a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450 (from https://www.piwheels.org/simple/attrs/), version: 17.4.0 Found link https://www.piwheels.org/simple/attrs/attrs-17.3.0-py2.py3-none-any.whl#sha256=e7d51b70f19a4da5fe6b3c9938983e0af3b91e230edc504bd73c443d98037063 (from https://www.piwheels.org/simple/attrs/), version: 17.3.0 Found link https://www.piwheels.org/simple/attrs/attrs-17.2.0-py2.py3-none-any.whl#sha256=a7e0d9183f6457de12df7ba6a81f6569c7d6b25f67ad509b5ad52e8545970a2f (from https://www.piwheels.org/simple/attrs/), version: 17.2.0 Found link https://www.piwheels.org/simple/attrs/attrs-17.1.0-py2.py3-none-any.whl#sha256=8d110cdca6189d1d11102838f52970e1c1943d6feb4822d5664ae484e2c9346a (from https://www.piwheels.org/simple/attrs/), version: 17.1.0 Found link https://www.piwheels.org/simple/attrs/attrs-16.3.0-py2.py3-none-any.whl#sha256=c59426b15b45e39a7bc408eb6ba7e7188d9532764f873cc691199ddd975c97ef (from https://www.piwheels.org/simple/attrs/), version: 16.3.0 Found link https://www.piwheels.org/simple/attrs/attrs-16.2.0-py2.py3-none-any.whl#sha256=ce9d6cac4705e5aeaca02d3ff72f0006bf9b0a2f29635ae8dab8262e296f6442 (from https://www.piwheels.org/simple/attrs/), version: 16.2.0 Found link https://www.piwheels.org/simple/attrs/attrs-16.1.0-py2.py3-none-any.whl#sha256=6274658d4041a6891bc060bb0bfbacaec78cefa846cf43879cf84575e94d67e6 (from https://www.piwheels.org/simple/attrs/), version: 16.1.0 Found link https://www.piwheels.org/simple/attrs/attrs-16.0.0-py2.py3-none-any.whl#sha256=c0baae43ed42ee57e73646f343469d148e606cb075846b76039053f445cbc03d (from https://www.piwheels.org/simple/attrs/), version: 16.0.0 Found link https://www.piwheels.org/simple/attrs/attrs-15.2.0-py2.py3-none-any.whl#sha256=8f5396e0ecf3e4945b81f1e2dd798b8c8f238c16ea8d8a9672d01a0358de9b0d (from https://www.piwheels.org/simple/attrs/), version: 15.2.0 Found link https://www.piwheels.org/simple/attrs/attrs-15.1.0-py2.py3-none-any.whl#sha256=fc48302e241d962cc560957d0cc8c3e3da0293b8fc342cd8808459ed2928f4c9 (from https://www.piwheels.org/simple/attrs/), version: 15.1.0 Found link https://www.piwheels.org/simple/attrs/attrs-15.0.0-py3-none-any.whl#sha256=1b8fd83b8c8cf4d266f76794a487b2c8eff39c976f548f2a7489f59847576fba (from https://www.piwheels.org/simple/attrs/), version: 15.0.0 Found link https://www.piwheels.org/simple/attrs/attrs-15.0.0a1-py3-none-any.whl#sha256=6325ad11d46f1f954b1e9b460686b53047f2c12cacb152a2b6f8cb44bd4a0a08 (from https://www.piwheels.org/simple/attrs/), version: 15.0.0a1 Given no hashes to check 6 links for project 'attrs': discarding no candidates Using version 19.3.0 (newest of versions: 17.4.0, 18.1.0, 18.2.0, 19.1.0, 19.2.0, 19.3.0) Collecting attrs>=17.4.0 Created temporary directory: /tmp/pip-unpack-aukklmi_ Found index url https://www.piwheels.org/simple https://www.piwheels.org:443 "GET /simple/attrs/attrs-19.3.0-py2.py3-none-any.whl HTTP/1.1" 200 39472
Downloading https://www.piwheels.org/simple/attrs/attrs-19.3.0-py2.py3-none-any.whl (39 kB) Added attrs>=17.4.0 from https://www.piwheels.org/simple/attrs/attrs-19.3.0-py2.py3-none-any.whl#sha256=08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c (from pytest) to build tracker '/tmp/pip-req-tracker-0svqyn6u'
Removed attrs>=17.4.0 from https://www.piwheels.org/simple/attrs/attrs-19.3.0-py2.py3-none-any.whl#sha256=08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c (from pytest) from build tracker '/tmp/pip-req-tracker-0svqyn6u' 1 location(s) to search for versions of packaging:

ERROR: Could not
find a version that satisfies the requirement packaging (from pytest)
(from versions: none) ERROR: No matching distribution found for
packaging (from pytest)

Exception information: Traceback (most recent call last): File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 216, in _main status = self.run(options, args) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper return func(self, options, args) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 324, in run requirement_set = resolver.resolve( File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 339, in _get_abstract_dist_for self._populate_link(req) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 305, in _populate_link req.link = self._find_requirement_link(req) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 270, in _find_requirement_link best_candidate = self.finder.find_requirement(req, upgrade) File "/home/pi/quantek_handheld/venv/lib/python3.8/site-packages/pip/_internal/index/package_finder.py", line 926, in find_requirement raise DistributionNotFound( pip._internal.exceptions.DistributionNotFound: No matching distribution found for packaging (from pytest) 1 location(s) to search for versions of pip:

hoefling
  • 39,011
  • 9
  • 90
  • 132
jsibs
  • 341
  • 3
  • 17
  • Please add the complete log of `pip3 install --no-cache-dir pytest -vvv` to the question. – hoefling Aug 19 '20 at 21:26
  • @hoefling please see output above. Thank you! – jsibs Aug 19 '20 at 21:51
  • 1
    Try running `pip3 install pytest --extra-index-url=https://pypi.org/simple`. Does it install `pytest` now? If yes, it looks like you have piwheels set as exclusive index in your `~/.config/pip/pip.conf` (Raspbian always has one). Check that for a setting `index_url = https://piwheels.org/simple` and change `index_url` to `extra_index_url`. If not, you may have some predefined `PIP_*` env vars, e.g. `PIP_INDEX_URL` etc. Check that via `env | grep -i pip_`. – hoefling Aug 19 '20 at 21:57
  • WOW. That worked! I've been working on this all day. Thank you so much. Mind posting it as an answer? Thank you @hoefling ! – jsibs Aug 19 '20 at 22:00
  • @hoefling `https://piwheels.org/simple` was already assigned to `extra-index-url` located at `/etc/pip.conf` and nothing came out when I ran `env | grep -i pip_` – jsibs Aug 19 '20 at 22:11
  • And you don't have the `~/.pip/pip.conf` file? Only the `/etc/pip.conf`? – hoefling Aug 19 '20 at 22:14
  • @hoefling that's correct. If I created one, would that be the solution as well? – jsibs Aug 19 '20 at 22:20
  • Yes, you could do this - check the edited answer for the recipe. I'll try to reproduce your issue tomorrow on my rpi's and come back with a better answer, if no one will do that before me. – hoefling Aug 19 '20 at 22:25

1 Answers1

2

Based on the log you provided, it looks like pip3 install only checks https://piwheels.org when looking for dist files. This indicates that https://piwheels.org is set as the exclusive index in the pip's config:

$ cat ~/.config/pip/pip.conf
[global]
index_url = https://piwheels.org/simple

Or check that via pip3 config:

$ pip3 config list 
global.index-url='https://piwheels.org/simple'

This will ignore https://pypi.org completely when looking for dists which is not you want, since piwheels only contains a small part of packages that require special tweaks to be built on ARM. To fix that, change index_url to extra_index_url in the config:

$ cat ~/.config/pip/pip.conf
[global]
extra_index_url = https://piwheels.org/simple

Now https://pypi.org will be queried first; if a package is not found, pip will query https://piwheels.org as a fallback.

Edit

Looks like your setup is somewhat different from what I'd usually expect. As a temporary workaround, you can create the ~/.config/pip/pip.conf with the following contents:

[global]
index_url = https://pypi.org/simple
extra_index_url = https://piwheels.org/simple

However, this only heals the symptoms, not the root issue. I will check that on my Raspberry Pi's tomorrow and add another edit with a proper solution.

hoefling
  • 39,011
  • 9
  • 90
  • 132
  • curious if you had time to test it on your pi? Thank you. – jsibs Aug 21 '20 at 05:28
  • @jsibs indeed, I did manage to set up Raspbian 10 on my RPi to be able to tinker with it. First of all, you are saying you have the issue with Python 3.8, but Raspbian 10 only offers Python 3.7 (although I'm using the beta 64bit OS, but it should make little to no difference). How did you install 3.8? – hoefling Aug 21 '20 at 08:14
  • when I was troubleshooting it, I read somewhere that it might be a Python versioning issue. That was one of the last changes I did, but obviously it didn't solve the problem. It was working on Python 3.7 when this error occurred. This is the exact way I installed Python 3.8 https://installvirtual.com/how-to-install-python-3-8-on-raspberry-pi-raspbian/ – jsibs Aug 21 '20 at 15:14
  • As a point of information, I am using an internal repository that is setup to proxy through pypi.org, but not pywheels.org. Not sure if this is relevant, even though the `/etc/pip.conf` was, by default, already set to `extra-index-url=https://piwheels.org/simple` – jsibs Aug 21 '20 at 15:26