Skip to content

Pip Overlooking Installed Packages? #10921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Jillinger opened this issue Feb 24, 2022 · 1 comment
Closed
1 task done

Pip Overlooking Installed Packages? #10921

Jillinger opened this issue Feb 24, 2022 · 1 comment
Labels
resolution: not a bug Determined as not a bug in pip

Comments

@Jillinger
Copy link

Jillinger commented Feb 24, 2022

Description

Here is my packages list... in part.

Package         Version
------------- -----------
......
rasterio           1.2.10
......

Rasterio 1.2.10 is already installed.
I also have the wheel in the same folder - e:\python\whl\downloads\rasterio-1.2.10-cp37-cp37m-win_amd64.whl
Now, I want to download a package ...
pip uses the cache, and tries to build the dependency, although it already exists.

Since the required package is already satisfied, why is pip not recognizing that?

Expected behavior

The dependency is already installed, I expect pip to recognize this. Perhaps it does, but is downloading the dependencies regardless, but considering the wheel is already in the folder, I expect pip to recognize this, and report the File was already downloaded.

pip version

pip 21.2.4

Python version

Python 3.7.3

OS

Windows

How to Reproduce

python -m pip download --no-cache-dir contextily==1.1.0

Output

(sklearn-env) E:\python\whl\downloads>python -m pip download --no-cache-dir contextily==1.1.0
Collecting contextily==1.1.0
  Downloading contextily-1.1.0-py3-none-any.whl (24 kB)
Collecting joblib
  Downloading joblib-1.1.0-py2.py3-none-any.whl (306 kB)
     |████████████████████████████████| 306 kB 1.3 MB/s
Collecting pillow
  File was already downloaded e:\python\whl\downloads\Pillow-9.0.1-cp37-cp37m-win_amd64.whl
Collecting requests
  File was already downloaded e:\python\whl\downloads\requests-2.27.1-py2.py3-none-any.whl
Collecting matplotlib
  File was already downloaded e:\python\whl\downloads\matplotlib-3.5.1-cp37-cp37m-win_amd64.whl
Collecting rasterio
  Downloading rasterio-1.2.10.tar.gz (2.3 MB)
     |████████████████████████████████| 2.3 MB 1.7 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\pcme\miniconda3\envs\sklearn-env\python.exe' 'C:\Users\pcme\miniconda3\envs\sklearn-env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\pcme\AppData\Local\Temp\tmppujti_q0'
       cwd: C:\Users\pcme\AppData\Local\Temp\pip-download-4yqe8wd_\rasterio_8aa718c2e5a64ee9a915e159bd3a6639
  Complete output (2 lines):
  INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
  ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable
.
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/44/5e/9f19e1e6fe980b59d8da8809f2e8f81eb7f0322c71914f077edcbcd9a110/rasterio-1.2.10.tar.gz#sha256=6062456047ba6494fe18bd0da98a383b6fad5306b16cd52a22e76c59172a2b5f (from https://pypi.org/simple/rasterio/) (requires-python:>=3.6). Command errored out with exit status 1: 'C:\Users\pcme\miniconda3\envs\sklearn-env\python.exe' 'C:\Users\pcme\miniconda3\envs\sklearn-env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\pcme\AppData\Local\Temp\tmppujti_q0' Check the logs for full command output.
  Downloading rasterio-1.2.9.tar.gz (2.3 MB)

Code of Conduct

@Jillinger Jillinger added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Feb 24, 2022
@pfmoore
Copy link
Member

pfmoore commented Feb 24, 2022

Because you're asking to download, not to install. (Download means download everything, because there's no guarantee the downloads will be used in the same environment as you ran the download from).

As to why pip is building the downloaded file, that's because of #1884

@pfmoore pfmoore added resolution: not a bug Determined as not a bug in pip and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Feb 24, 2022
@pfmoore pfmoore closed this as completed Feb 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: not a bug Determined as not a bug in pip
Projects
None yet
Development

No branches or pull requests

2 participants