2

I'm getting the below error message when attempting to install 'request' Python package running command pip install request:

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

Troubleshooting steps taken:

  • upgraded pip from 20.0.2 to pip 20.1.1 following this Stack Overflow
  • ran pip3 install request; received same error message
  • attempted to install version 0.0.14 of setupfiles from this Stack Overflow question; I received similar error message

Additional information:

It also looks like the package doesn't exist on the PyPI server anymore. If you Google search "pip install request", you should be able to see the request PyPI project is indexed and if you click it, you'll get a Error code 404.

Is there anything I'm missing? Or is there any other way to install the 'request' package? Is it available somewhere else?

Edit (for use-case context and examples): I'm trying to install a macOS virtual machine via Linux Manjaro. I'm following this Passthrough Post article. Under the "Basic Setup" section of the article, Python packages 'click' and 'request' are prerequisites dependencies. So the command would be pip install click request. If you see this video guide starting at 5:28 mark, he was able to run that command successfully and install the 'request' package.

Also, here is a screenshot example of it being imported from Flask: Request package imported from Flask example.jpeg

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
tikonux
  • 23
  • 1
  • 1
  • 5
  • 4
    `pip install requests` – Olvin Roght Jul 16 '20 at 08:13
  • @OlvinRoght @vvk24 Thanks, but that's not what I'm trying to install. To clarify for my use-case, I'm trying to install a macOS virtual machine via Linux Manjaro, following this guide https://passthroughpo.st/new-and-improved-mac-os-tutorial-part-1-the-basics/ Under the "Basic Setup" section of the guide, Python packages 'click' and 'request' are prerequisites dependencies. So the command would be `pip install click request`. If you see this video guide starting at 5:28 mark, he was able to install the `request`package: https://youtu.be/HipxJJhDPHA?t=328 – tikonux Jul 17 '20 at 08:15
  • 2
    **1.** Looks like a typo in the guide that you're trying to follow. [No _request_ on _PyPI_](https://pypi.org/project/request/), but [_requests_ on _PyPI_](https://pypi.org/project/requests/). _PyPI_ is the repository _pip_ installs from by default. I checked the _git_ repository linked in the guide and there is only mention of `import requests` not `request`. **2.** In the screenshot it reads `from flask import request` so you need to install `flask`. **3.** The bit in the video is inconclusive, doesn't make any sense to me. – sinoroc Jul 17 '20 at 08:59
  • After more research, it looks like there might have been a `request` project on _PyPI_ at some point, indeed. Might have been associated with this [_git_ repository](https://github.com/russianidiot/request.py) (deleted as well). Anyway, I am pretty sure the code you want to run needs `requests` and not `request`, so it doesn't matter that this other project existed at some point but is now missing. – sinoroc Jul 17 '20 at 09:03
  • I voted to reopen. It is a bit more complicated than a typo. Or at least the typo is not on the side of the one asking the question here. – sinoroc Jul 17 '20 at 09:10
  • @sinoroc Thanks for looking into this. I Googled 'pip install request' again and found it mentioned in [this Python discussion](http://www.tehunt.com/python-discuss/msg124293.html). You'll see that person collected the following packages when they ran `python3 -m pip install request`: request, get, post, query-string, public. Running that command on my end returns the same error in my initial post, but if you click each of the links those packages are referring to, you should be able to download them. – tikonux Jul 18 '20 at 15:47
  • Finally, after downloading those packages from those links, I was able to manually install them successfully following [this Stack Overflow](https://stackoverflow.com/questions/13270877/how-to-manually-install-a-pypi-module-without-pip-easy-install). – tikonux Jul 18 '20 at 16:32
  • Point is, I am pretty sure you don't need to install _request_, _get_, _post_, etc. to run the code from the _git_ repository linked in the article. The typo is in the article. The guy in the video follows the typo and makes it work, because he probably had _requests_ already installed anyway. But by actually reading the [code in the _git_ repository](https://github.com/foxlet/macOS-Simple-KVM/blob/e6c0b56fb70a264b6143e273443039e99f4af286/tools/FetchMacOS/fetch-macos.py#L10) it is clear that _request_ is unnecessary, you need _requests_ instead. – sinoroc Jul 18 '20 at 17:42
  • @sinoroc Ah, thanks for pointing that out. Marking your answer as solved/most helpful solution. Really appreciate your help on this, I was digging into this whole thing for the past few days. This will be helpful for anyone trying to do the same thing. – tikonux Jul 18 '20 at 21:04
  • '`request`' vs '`requests`' (the latter with '`s`'): [See](https://stackoverflow.com/questions/76440240/getting-this-error-while-installing-the-request-module-of-python?noredirect=1&lq=1#comment134785674_76440240) e.g. *[Several malicious typosquatted Python libraries found on PyPI repository](https://thehackernews.com/2021/07/several-malicious-typosquatted-python.html)*. That is, 'requests' (the real library) vs. 'request' (the malicious one). It is no wonder the [typosquatting](https://en.wikipedia.org/wiki/Typosquatting) attack was successful. – Peter Mortensen Jul 02 '23 at 17:16

2 Answers2

2

I think what are you trying to install is the "requests" package

BlueBeret
  • 474
  • 3
  • 23
  • Hi BlueBeret, thanks for your comment. But that's not what I'm trying to install. Please see updated post with context around my use-case with some examples. – tikonux Jul 17 '20 at 08:36
1

From what I understood...

There is a typo in the article. Where it says to install request it should actually say requests (plural, with an s at the end). The author of the screencast seems to make the same mistake, and I can only assume it is of no consequence to them, because they probably somehow had requests already installed beforehand in their Python environment.

This can be confirmed by reading the actual code in the git repository linked in the article. In particular the following lines:

import click
import requests

Update:

It seems like (at some point in time at least) the request (without the s at the end) package contained some malware:

sinoroc
  • 18,409
  • 2
  • 39
  • 70