-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot downgrade setuptools with pip when using the flags "-IU" #1104
Comments
I think the problem is your use of the > python -m venv env
> ./env/bin/pip freeze --all
pip==9.0.1
setuptools==28.8.0
> ./env/bin/pip install -U setuptools
Collecting setuptools
Using cached setuptools-36.2.3-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 28.8.0
Uninstalling setuptools-28.8.0:
Successfully uninstalled setuptools-28.8.0
Successfully installed setuptools-36.2.3
> ./env/bin/pip install -I 'setuptools==36.2.2'
Collecting setuptools==36.2.2
Using cached setuptools-36.2.2-py2.py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-36.2.3
> ./env/bin/pip freeze --all
pip==9.0.1
setuptools==36.2.3
> print -l env/lib/python3.6/site-packages/setuptools*
env/lib/python3.6/site-packages/setuptools
env/lib/python3.6/site-packages/setuptools-36.2.2.dist-info
env/lib/python3.6/site-packages/setuptools-36.2.3.dist-info |
And the behavior is the same with other packages. |
Thanks @benoit-pierre for the attention and the explanation. |
Not quite, even for upgrades I don't think it's a good idea to use it: > unzip -l dist/foo-0.1-py3-none-any.whl
Archive: dist/foo-0.1-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
0 2017-07-26 13:11 foo/__init__.py
0 2017-07-26 13:11 foo/mod1/__init__.py
39 2017-07-26 13:13 foo-0.1.dist-info/DESCRIPTION.rst
227 2017-07-26 13:13 foo-0.1.dist-info/metadata.json
4 2017-07-26 13:13 foo-0.1.dist-info/top_level.txt
92 2017-07-26 13:13 foo-0.1.dist-info/WHEEL
172 2017-07-26 13:13 foo-0.1.dist-info/METADATA
598 2017-07-26 13:13 foo-0.1.dist-info/RECORD
--------- -------
1132 8 files
> unzip -l dist/foo-0.2-py3-none-any.whl
Archive: dist/foo-0.2-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
0 2017-07-26 13:11 foo/__init__.py
0 2017-07-26 13:12 foo/mod2/__init__.py
39 2017-07-26 13:12 foo-0.2.dist-info/DESCRIPTION.rst
227 2017-07-26 13:12 foo-0.2.dist-info/metadata.json
4 2017-07-26 13:12 foo-0.2.dist-info/top_level.txt
92 2017-07-26 13:12 foo-0.2.dist-info/WHEEL
172 2017-07-26 13:12 foo-0.2.dist-info/METADATA
598 2017-07-26 13:12 foo-0.2.dist-info/RECORD
--------- -------
1132 8 files
> ./env/bin/pip install dist/foo-0.1-py3-none-any.whl
Processing ./dist/foo-0.1-py3-none-any.whl
Installing collected packages: foo
Successfully installed foo-0.1
> ./env/bin/pip install -I dist/foo-0.2-py3-none-any.whl
Processing ./dist/foo-0.2-py3-none-any.whl
Installing collected packages: foo
Successfully installed foo-0.2
> find env/lib/python3.6/site-packages/foo
env/lib/python3.6/site-packages/foo
env/lib/python3.6/site-packages/foo/mod2
env/lib/python3.6/site-packages/foo/mod2/__pycache__
env/lib/python3.6/site-packages/foo/mod2/__pycache__/__init__.cpython-36.pyc
env/lib/python3.6/site-packages/foo/mod2/__init__.py
env/lib/python3.6/site-packages/foo/mod1
env/lib/python3.6/site-packages/foo/mod1/__pycache__
env/lib/python3.6/site-packages/foo/mod1/__pycache__/__init__.cpython-36.pyc
env/lib/python3.6/site-packages/foo/mod1/__init__.py
env/lib/python3.6/site-packages/foo/__pycache__
env/lib/python3.6/site-packages/foo/__pycache__/__init__.cpython-36.pyc
env/lib/python3.6/site-packages/foo/__init__.py |
I see your point and thanks again for the explanation. The issue I was trying to solve with the Running Now I understand that, if I want the build to be as much convergent as possible, I have to run first |
What about with |
Thanks I missed that option! |
Unluckily
|
You need to combine it with upgrade: > pip install -h | grep force-reinstall
--force-reinstall When upgrading, reinstall all packages even if they are already up-to-date. |
That works great! Thanks :) |
If I have the last version of setuptools in my virtualenv, then I am not able anymore to downgrade it when I specify the -IU flags:
With other packages, it works as I would expect, i.e. the setuptools version is the one I pin through the command line or with the requirements file.
A workaround is to run the command twice, e.g.:
The text was updated successfully, but these errors were encountered: