Search code examples
pythonpippackagepypi

Python error when attempting to install 'request' package using pip


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


Solution

  • 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: