Skip to content
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

incorrect behavior of pip install --upgrade pip #3433

Closed
rgommers opened this issue Jan 29, 2016 · 33 comments
Closed

incorrect behavior of pip install --upgrade pip #3433

rgommers opened this issue Jan 29, 2016 · 33 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@rgommers
Copy link

It installs a different version (7.1.2) than it downloaded (8.0.2). No idea how that's even possible, even if I had a 7.1.2 wheel already cached from an install for a different Python version.

<installed something ...>
You are using pip version 6.0.3, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

rgommers@machine:~/Code/tmp$ pip install --upgrade pip
/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting pip
  Downloading pip-8.0.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 226kB/s
Installing collected packages: pip
  Found existing installation: pip 6.0.3
    Uninstalling pip-6.0.3:
      Successfully uninstalled pip-6.0.3
Successfully installed pip-7.1.2
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

rgommers@machine:~/Code/tmp$ pip install --upgrade pip
Collecting pip
  Using cached pip-8.0.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 7.1.2
    Uninstalling pip-7.1.2:
      Successfully uninstalled pip-7.1.2
Successfully installed pip-8.0.2
@xavfernandez
Copy link
Member

You likely have an other pip install that shadows the one being installed.

pip reports the installed version it sees after the installation.

@rgommers
Copy link
Author

Hmm, I don't quite get how that can be the case. If the pip that's first on my path is 6.0.3, and that pip upgrades itself, then that should still be the first one on my path afterwards right?

I'm still not sure if it installed 8.0.2 and only the reporting is incorrect, or it actually installed a different wheel than it downloaded. The latter would be worse, but either way it's a bug I'd think.

@stonebig
Copy link
Contributor

Would the issue diseappear if you use "--no-cache-dir" option of pip ? (suspecting the cache management of pip, or between versions of pip)

@rgommers
Copy link
Author

The issue seems to be that when you have two or more pips installed in different places, it uninstalls the one that's first on the path, then reports that it has installed the version that is already installed.

This I concluded from another attempt on a different machine:

$ pip install --upgrade pip --user
Collecting pip
  Using cached pip-8.0.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.0.0.dev0
    Uninstalling pip-8.0.0.dev0:
      Successfully uninstalled pip-8.0.0.dev0
Successfully installed pip-1.5.4
You are using pip version 1.5.4, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
rgommers@machine:~/Code/numpy (master)$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

dist-packages is the one shipped with the OS. And since I didn't use sudo, I'm sure that 1.5.4 wasn't actually installed even though pip tells me that.

@stonebig
Copy link
Contributor

would it be possible that pip is looking in all your path for packages , giving back a merge of the two places ?

                import imp, pip
                pip.utils.pkg_resources = imp.reload(pip.utils.pkg_resources)
                pip_list = [(i.key, i.version)
                             for i in pip.get_installed_distributions()]

@rgommers
Copy link
Author

Don't think that's it. It goes wrong somewhere in the ping pong between RequirementSet.install and InstallRequirement.install.

@xavfernandez
Copy link
Member

Well, maybe the phrasing should be improved, pip should report the installed version and not the one on the path ?

@rgommers
Copy link
Author

@xavfernandez I don't think that helps - I'm still ending up with an older pip after trying to upgrade it. What should happen here is:

  1. Install the downloaded wheel.
  2. Report that that was done.

What happens at the moment is:

  1. Download the correct wheel.
  2. Not install that wheel to anywhere.
  3. Report that it installed the older (previously shadowed already installed) pip while it actually did absolutely nothing.

@rgommers
Copy link
Author

I haven't found a good way to debug this by the way. I can reproduce the issue, but it's hard to figure out what is being done. And since pip uninstalls itself during reproducing this bug, it's kind of hard to drop into a debugger or not lose the inserted print statements :)

@xavfernandez
Copy link
Member

@rgommers If you can reproduce it, could you add a print here:

clobber(source, lib_dir, True)
to check where pip is installing the new pip ? And check that the install was correctly performed ?

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

how fun: today the same issue on windows (just setuptools instead of pip):

D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64>pip install --upgrade setuptools
Collecting setuptools
  Using cached setuptools-19.6.2-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 19.4
    Uninstalling setuptools-19.4:
      Successfully uninstalled setuptools-19.4
Successfully installed setuptools-19.4

pip list indicates setuptools-19.4 after that.

trying the exact same command again (on same dos session), I get a:

D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64>pip install --upgr
ade setuptools
Collecting setuptools
  Using cached setuptools-19.6.2-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 19.4
Exception:
Traceback (most recent call last):
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\basecommand.py", line 209, in main
    status = self.run(options, args)
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\req\req_set.py", line 725, in install
    requirement.uninstall(auto_confirm=True)
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\req\req_install.py", line 709, in uninstall
    for path in pip.wheel.uninstallation_paths(dist):
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\wheel.py", line 532, in unique
    for item in fn(*args, **kw):
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\wheel.py", line 551, in uninstallation_paths
    r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\_vendor\pkg_resources\__init__.py", line 1624, in get_metadata_lines

    return yield_lines(self.get_metadata(name))
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\_vendor\pkg_resources\__init__.py", line 1621, in get_metadata
    return self._get(self._fn(self.egg_info, name)).decode("utf-8")
  File "D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib\site-p
ackages\pip\_vendor\pkg_resources\__init__.py", line 1727, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'd:\\result_tests\\winpy
thon-3.4.4.1qt5.amd64\\python-3.4.4.amd64\\lib\\site-packages\\setuptools-19.4.d
ist-info\\RECORD'

D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64>

there is zero system "Python" on my pc, the path is clean from other Pythons (which are legions)

Path=D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\Lib\site-pack
ages\PyQt5;D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\Lib\sit
e-packages\PyQt4;D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\;
D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\DLLs;D:\result_tes
ts\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\Scripts;D:\result_tests\winpyth
on-3.4.4.1Qt5.amd64\python-3.4.4.amd64\..\tools;D:\result_tests\winpython-3.4.4.
1Qt5.amd64\python-3.4.4.amd64\..\tools\mingw32\bin;D:\result_tests\winpython-3.4
.4.1Qt5.amd64\python-3.4.4.amd64\..\tools\R\bin\x64;D:\result_tests\winpython-3.
4.4.1Qt5.amd64\python-3.4.4.amd64\..\tools\Julia\bin;C:\Program Files\Common Fil
es\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft S
hared\Windows Live;C:\Users\Lauriane\Downloads\ruby-Scite\bin;C:\Windows\system3
2;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0
\;c:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\
ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Bluetooth Software
\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Wi
ndows Live\Shared;C:\Users\Lauriane\Downloads\Install\android-sdk-windows\tools;
C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Mic
rosoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\
Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Common Files\Microsof
t Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windo
ws Live;C:\Users\Lauriane\Downloads\ruby-Scite\bin;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Progra
m Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\ATI Technol
ogies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Progra
m Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\
Shared;C:\Users\Lauriane\Downloads\Install\android-sdk-windows\tools;C:\Program
Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;

==> does it give a clue to the problem ?

thon-3.4.4.1qt5.amd64\\python-3.4.4.amd64\\lib\\site-packages\\s
ist-info\\RECORD'

D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64>pi
adodbapi (2.6.0.7)
alabaster (0.7.7)
astroid (1.4.4)
astroML (0.3)
Babel (2.2.0)
backports-abc (0.4)
baresql (0.7.3)
bcolz (0.12.1)
beautifulsoup4 (4.4.1)
blaze (0.9.0)
blosc (1.2.8)
bloscpack (0.9.0)
bokeh (0.11.0)
Bottleneck (1.0.0)
bqplot (0.5.1)
brewer2mpl (1.4.1)
castra (0.1.6)
certifi (2015.11.20.1)
cffi (1.5.0)
click (6.2)
cloudpickle (0.1.1)
colorama (0.3.5)
cvxopt (1.1.7)
cx-Freeze (4.3.4)
cycler (0.9.0)
cyordereddict (0.2.2)
Cython (0.23.4)
cytoolz (0.7.4)
dask (0.7.6)
datashape (0.5.0)
db.py (0.4.4)
decorator (4.0.6)
dill (0.2.4)
docopt (0.6.2)
docutils (0.12)
emcee (2.1.0)
Flask (0.10.1)
formlayout (1.1.0)
geopy (1.11.0)
greenlet (0.4.9)
guidata (1.7.5)
guiqwt (3.0.2)
h5py (2.5.0)
holoviews (1.4.1)
html5lib (0.9999999)
husl (4.0.3)
ipykernel (4.2.2)
ipyparallel (4.1.0)
ipython (4.0.3)
ipython-genutils (0.1.0)
ipython-sql (0.3.7.1)
ipywidgets (4.1.1)
itsdangerous (0.24)
jedi (0.9.0)
Jinja2 (2.8)
joblib (0.9.4)
jsonschema (2.5.1)
julia (0.1.1.8)
jupyter (1.0.0)
jupyter-client (4.1.1)
jupyter-console (4.1.0)
jupyter-core (4.0.6)
Keras (0.3.1)
lazy-object-proxy (1.2.1)
llvmlite (0.6.0)
lmfit (0.9.2)
locket (0.2.0)
lxml (3.5.0)
Markdown (2.6.5)
MarkupSafe (0.23)
matplotlib (1.5.1)
mingwpy (0.1.0b3)
mistune (0.7.1)
mpld3 (0.2)
multipledispatch (0.4.8)
mysql-connector-python (2.0.4)
nbconvert (4.1.0)
nbformat (4.0.1)
netCDF4 (1.2.2)
networkx (1.10)
nltk (3.0.5)
nose (1.3.7)
notebook (4.1.0)
numba (0.20.0)
numexpr (2.4.6)
numpy (1.10.4)
numpydoc (0.5)
oct2py (3.4.0)
odo (0.4.0)
pandas (0.17.1)
pandas-datareader (0.2.0)
param (1.3.2)
partd (0.3.2)
path.py (8.1.2)
patsy (0.4.1)
pep8 (1.7.0)
pg8000 (1.10.2)
pickleshare (0.6)
Pillow (3.1.0)
pip (8.0.2)
pkginfo (1.2.1)
prettytable (0.7.2)
prompt-toolkit (0.57)
psutil (3.4.2)
ptpython (0.28)
PuLP (1.6.1)
py (1.4.31)
PyAudio (0.2.9)
pybars3 (0.9.1)
pycparser (2.14)
pyflakes (0.9.2)
Pygments (2.1)
pylint (1.5.4)
pymc (2.3.6)
PyMeta3 (0.5.1)
pymongo (3.2)
pyodbc (3.0.10)
PyOpenGL (3.1.1b1)
pyparsing (2.0.7)
pyqtgraph (0.9.10)
pyreadline (2.1)
pyserial (3.0.1)
pystache (0.5.4)
pytest (2.8.5)
python-dateutil (2.4.2)
python-hdf4 (0.9)
PythonQwt (0.5.5)
pytz (2015.7)
pywin32 (220)
PyYAML (3.11)
pyzmq (15.2.0)
QtAwesome (0.2.0)
qtconsole (4.1.1)
QtPy (0.1.3)
redis (2.10.5)
reportlab (3.2.0)
requests (2.9.1)
requests-toolbelt (0.5.1)
rope-py3k (0.9.4.post1)
rpy2 (2.7.7)
Rx (1.2.4)
scikit-image (0.11.3)
scikit-learn (0.17)
scilab2py (0.6)
scipy (0.17.0)
seaborn (0.7.0.dev0)
setuptools (19.4)
simplegeneric (0.8.1)
simplejson (3.8.1)
six (1.10.0)
snowballstemmer (1.2.1)
Sphinx (1.3.5)
sphinx-rtd-theme (0.1.9)
spyder (3.0.0.dev0)
SQLAlchemy (1.0.11)
sqlite-bro (0.8.10)
sqlparse (0.1.18)
statsmodels (0.6.1)
sympy (0.7.6.1)
tables (3.2.2)
Theano (0.7.0)
toolz (0.7.4)
tornado (4.3)
traitlets (4.1.0)
twine (1.6.5)
twitter (1.17.1)
wcwidth (0.1.6)
Werkzeug (0.11.3)
wheel (0.26.0)
winpython (1.3)
wrapt (1.10.6)
xarray (0.7.0)
xlrd (0.9.4)
XlsxWriter (0.8.4)

D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64>

and I don't reach the

clobber(source, lib_dir, True)
where I put a print now.

    print("*** clobbering source, lib_dir", source, " *** ",  lib_dir)
    clobber(source, lib_dir, True)

I did that just after doing the same upgrade on a python 2.7, with no apparent failure, in another dos process, but in same user session.

@pfmoore
Copy link
Member

pfmoore commented Feb 1, 2016

To get the data to properly diagnose this, we really need the following:

  1. Reproduce the issue without the wrapper - i.e., use python -m pip rather than pip as the command.
  2. Include the output of pip version and python -m pip --version (both of them - they may be different if the problem is which wrapper you're picking up).
  3. Run the following, to confirm Python's idea of where pip is: python -c "import sys, pip; print(sys.path); print(pip.__file__)".

Really, we need the above from before reproducing the issue - maybe after as well, for completeness, but before is the key one. Because after you reproduce the issue, you've possibly changed what pip versions are installed (although not in the way you wanted to, unfortunately :-().

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

just a possibility of idea, I moved these directories, and I can see a reference to the original place in the, for example, D:\result_tests\winpython-3.4.3.6\python-3.4.3\Lib\site-packages\setuptools-18.4.dist-info "RECORD" file:

easy_install.py,sha256=MDC9vt5AxDsXX5qcKlBz2TnW6Tpuv_AobnfhCJ9X3PM,126
_markerlib/__init__.py,sha256=GSmhZqvAitLJHhSgtqqusfq2nJ_ClP3oy3Lm0uZLIsU,552
_markerlib/markers.py,sha256=YuFp0-osufFIoqnzG3L0Z2fDCx4Vln3VUDeXJ2DA_1I,3979
pkg_resources/__init__.py,sha256=R4kmy7j1rRyAbK1b03lZJBtVJThYlEMf0nlSFo9Uf8Q,106486
pkg_resources/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pkg_resources/_vendor/packaging/__about__.py,sha256=YzdrW-1lWmyCBDyrcNkZbJo4tiDWXpoiqPjfyCYMzIE,1073
pkg_resources/_vendor/packaging/__init__.py,sha256=2V8n-eEpSgBuXlV8hlMmhU7ZklpsrrusWMZNp2gC4Hs,906
pkg_resources/_vendor/packaging/_compat.py,sha256=wofog8iYo_zudt_10i6JiXKHDs5GhCuXC09hCuSJiv4,1253
pkg_resources/_vendor/packaging/_structures.py,sha256=93YvgrEE2HgFp8AdXy0pwCRVnZeutRHO_-puJ7T0cPw,1809
pkg_resources/_vendor/packaging/specifiers.py,sha256=UV9T01_kKloA8PSeMI3HTYBSJ_4KLs00yLvrlciZ3yU,28079
pkg_resources/_vendor/packaging/version.py,sha256=dEGrWZJZ6sef1xMxSfDCego2hS3Q86by0hUIFVk-AGc,11949
setuptools/__init__.py,sha256=3k29_xXPwjFtkdBbuqaQ-VA3_Mdqyq4ADDIwfsc9ISo,5424
setuptools/archive_util.py,sha256=N30WE5ZQjkytzhAodAXw4FkK-9J5AP1ChrClHnZthOA,6609
setuptools/cli-32.exe,sha256=dfEuovMNnA2HLa3jRfMPVi5tk4R7alCbpTvuxtCyw0Y,65536
setuptools/cli-64.exe,sha256=KLABu5pyrnokJCv6skjXZ6GsXeyYHGcqOUT3oHI3Xpo,74752
setuptools/cli-arm-32.exe,sha256=0pFNIi2SmY2gdY91Y4LRhj1wuBsnv5cG1fus3iBJv40,69120
setuptools/cli.exe,sha256=dfEuovMNnA2HLa3jRfMPVi5tk4R7alCbpTvuxtCyw0Y,65536
setuptools/compat.py,sha256=-Hl58PuLOEHUDM3-qsgmk50qNiyLLF3RgBgJ-eGGZG0,2094
setuptools/depends.py,sha256=gMRnrqQSr_Yp_wf09O88vKSQah1YjjEi5PsDNezM2Hs,6370
setuptools/dist.py,sha256=alEPOcofbGQSfkVQk6h0yEGNyKiQyCvNQa5YmnUm6wU,35320
setuptools/extension.py,sha256=nQ9GFTKxRIwmE1W7t1ZSBmuPAUJK_gVRYOCwxA1L38U,1649
setuptools/gui-32.exe,sha256=XBr0bHMA6Hpz2s9s9Bzjl-PwXfa9nH4ie0rFn4V2kWA,65536
setuptools/gui-64.exe,sha256=aYKMhX1IJLn4ULHgWX0sE0yREUt6B3TEHf_jOw6yNyE,75264
setuptools/gui-arm-32.exe,sha256=R5gRWLkY7wvO_CVGxoi7LZVTv0h-DKsKScy6fkbp4XI,69120
setuptools/gui.exe,sha256=XBr0bHMA6Hpz2s9s9Bzjl-PwXfa9nH4ie0rFn4V2kWA,65536
setuptools/lib2to3_ex.py,sha256=6jPF9sJuHiz0cyg4cwIBLl2VMAxcl3GYSZwWAOuJplU,1998
setuptools/msvc9_support.py,sha256=fo2vjb-dna1SEuHezQCTuelCo6XFBv5cqaI56ABJ1vw,2187
setuptools/package_index.py,sha256=aavWGle1RtmelMjeTOxjFoGpEdGdGY4hfRnLHUkbD0c,38760
setuptools/py26compat.py,sha256=ggKS8_aZWWHHS792vF3uXp5vmUkGNk3vjLreLTHr_-Q,431
setuptools/py27compat.py,sha256=CGj-jZcFgHUkrEdLvArkxHj96tAaMbG2-yJtUVU7QVI,306
setuptools/py31compat.py,sha256=O3X_wdWrvXTifeSFbRaCMuc23cDhMHJn7QlITb5cQ8E,1637
setuptools/sandbox.py,sha256=Gg5UfpsC5xsg_1x68pWRXG4t3nRWNpTk7m13lrnMTKw,13925
setuptools/script (dev).tmpl,sha256=f7MR17dTkzaqkCMSVseyOCMVrPVSMdmTQsaB8cZzfuI,201
setuptools/script.tmpl,sha256=WGTt5piezO27c-Dbx6l5Q4T3Ff20A5z7872hv3aAhYY,138
setuptools/site-patch.py,sha256=K-0-cAx36mX_PG-qPZwosG9ZLCliRjquKQ4nHiJvvzg,2389
setuptools/ssl_support.py,sha256=FASqXlRCmXAi6LUWLUIo0u14MpJqHBgkOc5KPHSRrtI,8044
setuptools/unicode_utils.py,sha256=gvhAHRj1LELCz-1MP3rfXGi__O1CAm5aksO9Njd2lpU,981
setuptools/utils.py,sha256=08Z7mt-9mvrx-XvmS5EyKoRn2lxNTlgFsUwBU3Eq9JQ,293
setuptools/version.py,sha256=Z8-0EiaDhQHzkgyFEGg-HQosCNYv_kVYK6OXtzthQZc,21
setuptools/windows_support.py,sha256=5GrfqSP2-dLGJoZTq2g6dCKkyQxxa2n5IQiXlJCoYEE,714
setuptools/command/__init__.py,sha256=gQMXoLa0TtUtmUZY0ptSouWWA5kcTArWyDQ6QwkjoVQ,554
setuptools/command/alias.py,sha256=1sLQxZcNh6dDQpDmm4G7UGGTol83nY1NTPmNBbm2siI,2381
setuptools/command/bdist_egg.py,sha256=3eblnHDm1t8Hwh8K5z1QaWOVkxUvxQc40KV_YZVHNFs,17184
setuptools/command/bdist_rpm.py,sha256=B7l0TnzCGb-0nLlm6rS00jWLkojASwVmdhW2w5Qz_Ak,1508
setuptools/command/bdist_wininst.py,sha256=_6dz3lpB1tY200LxKPLM7qgwTCceOMgaWFF-jW2-pm0,637
setuptools/command/build_ext.py,sha256=pkQ8xp3YPVGGLkGv-SvfxC_GqFpboph1AFEoMFOgQMo,11964
setuptools/command/build_py.py,sha256=uTgiBroMgyV-Lq4Kt42PLWQknM9G8c8_6TiDv4H5_Sw,7915
setuptools/command/develop.py,sha256=uyRwABU1JnhQhZO9rS8-nenkzLwKKJt2P7WPnsXrHd4,6610
setuptools/command/easy_install.py,sha256=_gRt2BDjiJpHuDPJzOFOTThWjspKy7NYIV_Br_PmyB0,87190
setuptools/command/egg_info.py,sha256=7AEcwMZQ5zl48_Cu_srTxCUqlJBokW10jRlFHZof2fs,16852
setuptools/command/install.py,sha256=QwaFiZRU3ytIHoPh8uJ9EqV3Fu9C4ca4B7UGAo95tws,4685
setuptools/command/install_egg_info.py,sha256=KXNB8O34-rK-cZZZr2fnT8kqNktDmTfUA88X2Iln66c,4001
setuptools/command/install_lib.py,sha256=ntpy-9xiFHfDmXmX_Lfp7nMchw7FpgyP66H7reixI_Y,3771
setuptools/command/install_scripts.py,sha256=vX2JC6v7l090N7CrTfihWBklNbPvfNKAY2LRtukM9XE,2231
setuptools/command/launcher manifest.xml,sha256=xlLbjWrB01tKC0-hlVkOKkiSPbzMml2eOPtJ_ucCnbE,628
setuptools/command/register.py,sha256=bHlMm1qmBbSdahTOT8w6UhA-EgeQIz7p6cD-qOauaiI,270
setuptools/command/rotate.py,sha256=Qm7SOa32L9XG5b_C7_SSYvKM5rqFXroeQ6w8GXIsY2o,2038
setuptools/command/saveopts.py,sha256=za7QCBcQimKKriWcoCcbhxPjUz30gSB74zuTL47xpP4,658
setuptools/command/sdist.py,sha256=rMT2qS0u4GYJtL4IXiYG-ElEa111wqzQVHpv9uE1L5w,7079
setuptools/command/setopt.py,sha256=Z3_kav60D2XHZjM0cRhGo7wbBYo7nr4U_U-wMMbpmu8,5080
setuptools/command/test.py,sha256=yJEniqTzav6R6vimRG3tb7l233rGDSAmFafXIHe9UzU,6562
setuptools/command/upload_docs.py,sha256=di-XRGtxW5TSFYR6nK9XZj3I5JIU4V00SOFRhptdOGc,6782
setuptools-18.4.dist-info/DESCRIPTION.rst,sha256=MDsJej8DPV2OKpAKpu74g-2xksRd-uGTeZn4W7D1dnI,9940
setuptools-18.4.dist-info/METADATA,sha256=Q_x_vxlzhC75Iv8pWwiXkF2Jujl90vGjawoB3CYBBH0,11356
setuptools-18.4.dist-info/RECORD,,
setuptools-18.4.dist-info/WHEEL,sha256=5f-Lb0dq-Ei5P75pgK065AnrFl2dK_ZqskZBpCbWERA,116
setuptools-18.4.dist-info/dependency_links.txt,sha256=g1tkmtmOY1n1KRGVLZKBtbJf0CCZ2Jil8uGvMfQRJNE,226
setuptools-18.4.dist-info/entry_points.txt,sha256=onl7Sx2F17bePHudEa8LCcIjSkDdjuNkV2qVuTcThJ4,2793
setuptools-18.4.dist-info/metadata.json,sha256=YawjpOv1xOS9GQtM5hYabVdDU5QiVh0wjTLa3sVQR8Y,4760
setuptools-18.4.dist-info/top_level.txt,sha256=7780fzudMJkykiTcIrAQ8m8Lll6kot3EEePye3VJgEE,49
setuptools-18.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
D:\Winpython\basedir34\build\winpython-3.4.3\python-3.4.3\Scripts\easy_install.exe,sha256=zGqBwNVdjQ4YWnU0VuxVISLMJ801mYCZ3q8IXswHj84,92054
D:\Winpython\basedir34\build\winpython-3.4.3\python-3.4.3\Scripts\easy_install-3.4.exe,sha256=zGqBwNVdjQ4YWnU0VuxVISLMJ801mYCZ3q8IXswHj84,92054
pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-34.pyc,,
setuptools/__pycache__/ssl_support.cpython-34.pyc,,
pkg_resources/_vendor/__pycache__/__init__.cpython-34.pyc,,
setuptools/command/__pycache__/install_egg_info.cpython-34.pyc,,
setuptools/__pycache__/extension.cpython-34.pyc,,
setuptools/command/__pycache__/saveopts.cpython-34.pyc,,
setuptools/__pycache__/unicode_utils.cpython-34.pyc,,
setuptools/command/__pycache__/__init__.cpython-34.pyc,,
setuptools/__pycache__/windows_support.cpython-34.pyc,,
pkg_resources/__pycache__/__init__.cpython-34.pyc,,
setuptools/command/__pycache__/easy_install.cpython-34.pyc,,
setuptools/__pycache__/py26compat.cpython-34.pyc,,
setuptools/command/__pycache__/build_py.cpython-34.pyc,,
setuptools/command/__pycache__/build_ext.cpython-34.pyc,,
setuptools/__pycache__/site-patch.cpython-34.pyc,,
_markerlib/__pycache__/__init__.cpython-34.pyc,,
setuptools/__pycache__/lib2to3_ex.cpython-34.pyc,,
setuptools/__pycache__/py31compat.cpython-34.pyc,,
setuptools/command/__pycache__/test.cpython-34.pyc,,
setuptools/__pycache__/msvc9_support.cpython-34.pyc,,
setuptools/command/__pycache__/bdist_egg.cpython-34.pyc,,
pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-34.pyc,,
setuptools/command/__pycache__/install.cpython-34.pyc,,
setuptools/command/__pycache__/setopt.cpython-34.pyc,,
setuptools/command/__pycache__/upload_docs.cpython-34.pyc,,
setuptools/__pycache__/depends.cpython-34.pyc,,
__pycache__/easy_install.cpython-34.pyc,,
setuptools/__pycache__/archive_util.cpython-34.pyc,,
setuptools/command/__pycache__/install_scripts.cpython-34.pyc,,
pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-34.pyc,,
setuptools/__pycache__/utils.cpython-34.pyc,,
setuptools/command/__pycache__/install_lib.cpython-34.pyc,,
setuptools/__pycache__/compat.cpython-34.pyc,,
setuptools/__pycache__/package_index.cpython-34.pyc,,
setuptools/command/__pycache__/rotate.cpython-34.pyc,,
pkg_resources/_vendor/packaging/__pycache__/_compat.cpython-34.pyc,,
setuptools/command/__pycache__/bdist_wininst.cpython-34.pyc,,
setuptools/__pycache__/sandbox.cpython-34.pyc,,
setuptools/command/__pycache__/alias.cpython-34.pyc,,
setuptools/__pycache__/py27compat.cpython-34.pyc,,
setuptools/__pycache__/dist.cpython-34.pyc,,
setuptools/__pycache__/__init__.cpython-34.pyc,,
pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-34.pyc,,
_markerlib/__pycache__/markers.cpython-34.pyc,,
pkg_resources/_vendor/packaging/__pycache__/version.cpython-34.pyc,,
setuptools/__pycache__/version.cpython-34.pyc,,
setuptools/command/__pycache__/sdist.cpython-34.pyc,,
setuptools/command/__pycache__/develop.cpython-34.pyc,,
setuptools/command/__pycache__/egg_info.cpython-34.pyc,,
setuptools/command/__pycache__/register.cpython-34.pyc,,
setuptools/command/__pycache__/bdist_rpm.cpython-34.pyc,,

there are two non-relative path in there:

D:\Winpython\basedir34\build\winpython-3.4.3\python-3.4.3\Scripts\easy_install.exe,sha256=zGqBwNVdjQ4YWnU0VuxVISLMJ801mYCZ3q8IXswHj84,92054
D:\Winpython\basedir34\build\winpython-3.4.3\python-3.4.3\Scripts\easy_install-3.4.exe,sha256=zGqBwNVdjQ4YWnU0VuxVISLMJ801mYCZ3q8IXswHj84,92054

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

I think the initial break is that pip from

pip 8.0.2 from D:\result_tests\winpython-3.4.4.1Qt5.amd64\python-3.4.4.amd64\lib
\site-packages

did find and removed easy_install.exe at

D:\WinPython\basedir34\buildQt5\winpython-3.4.4.amd64\python-3.4.4.amd64\Scripts

where the original build was made (and a new one after)

@pfmoore
Copy link
Member

pfmoore commented Feb 1, 2016

just a possibility of idea, I moved these directories

Ha, that's the issue. Moving/renaming the Python directory isn't something I'd recommend (and definitely isn't something you should do without understanding the implications). As you can see, there are absolute pathnames in there, so that's likely your issue.

I'd say that we try to do our best to make pathnames relative, but it's not something we guarantee - and it's not always pip that writes the RECORD data, so it's just as likely to be something like setuptools. You can probably manually fix things up if you do move the directory, but it's definitely an area where "if you break it, you get to keep both pieces" applies :-)

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

so it's a setuptools corner-case bug ? does it explain rgommers issue ?

@pfmoore
Copy link
Member

pfmoore commented Feb 1, 2016

It's a result of you doing something unsupported (moving a Python installation). It's unlikely to be the same as @rgommers issue unless he moved his Python installation.

You might be able to get some support for the idea that tools should ensure that all paths in RECORD that refer to locations in site-packages should be relative, but it's not right to call it a bug.

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

and which tools do write that RECORD (and delete based on it) ? so I can ask for a feature improvement in my corner case ? (it's not a bug, it's a lack of feature)

@rgommers
Copy link
Author

rgommers commented Feb 1, 2016

It's a result of you doing something unsupported (moving a Python installation). It's unlikely to be the same as @rgommers issue unless he moved his Python installation.

No, I definitely didn't do that on any of my systems.

@pfmoore
Copy link
Member

pfmoore commented Feb 1, 2016

and which tools do write that RECORD (and delete based on it) ?

I'm not sure. At least setuptools, and I think distutils. And pip and wheel for wheel-based installs. In this case (an exe wrapper) you can exclude distutils, as it doesn't write exe wrappers. Which is the likely culprit depends on how you installed setuptools.

And BTW, I stand corrected on whether it's a bug - https://www.python.org/dev/peps/pep-0376/#record seems to state that this should be a relative path (the second case for a path applies, I think). But PEP 376 hasn't been followed particularly closely, historically, so don't assume that a PEP 376 incompatibility will be seen as a major problem in itself.

@xavfernandez
Copy link
Member

@rgommers since you apparently found a way to reproduce the issue, could you run python -c "from pkg_resources import Environment;print(Environment()['pip'])" before and after the upgrade ?

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

@pfmoore I try to do only wheel installations, so do I understand well that pip is the program who writes (and later replay for removal) these absolute-path records in RECORD ?

@pfmoore
Copy link
Member

pfmoore commented Feb 1, 2016

Sounds possible.

@stonebig
Copy link
Contributor

stonebig commented Feb 1, 2016

so maybe this is the right place to ask for this tiny improvement ?

@pfmoore
Copy link
Member

pfmoore commented Feb 2, 2016

The usual reply applies - contributions gratefully accepted :-) (Personally, hunting down where this occurs isn't going to be a high priority for me) But yes, the issue is noted.

@stonebig
Copy link
Contributor

stonebig commented Feb 2, 2016

I failed to guess yesterday on which part of pip, when installing a wheel, the RECORD is written (especially for the entry-point records which are my concern). could you pinpoint me to the correct part of program of the project ?

(same for uninstall or upgrade would be nice also)

@pfmoore
Copy link
Member

pfmoore commented Feb 2, 2016

I'd guess pip/wheel.py but it is just a guess, I've not checked the code.

@stonebig
Copy link
Contributor

stonebig commented Feb 2, 2016

interesting, if I look at https://github.com/pypa/pip/blob/develop/pip/wheel.py#L274..L283

the following example:

import os
def normpath(src, p):
        return os.path.relpath(src, p).replace(os.path.sep, '/')

def record_installed(srcfile, destfile, modified=False):
        """Map archive RECORD paths to installation RECORD paths."""
        oldpath = normpath(srcfile, wheeldir)
        newpath = normpath(destfile, lib_dir)
        installed[oldpath] = newpath
        if modified:
            changed.add(destfile)
final=r"D:\Winpython\basedir34\build\winpython-3.4.4.amd64\python-3.4.4.amd64\Scripts\easy_install.exe"
p=r"D:\WinPython\basedir34\build\winpython-3.4.4.amd64\python-3.4.4.amd64\Lib\site-packages"
normpath(final, p)

gives me a correct relative result.

'../../Scripts/easy_install.exe'

@stonebig
Copy link
Contributor

stonebig commented Feb 2, 2016

looking further, I found the last one of the group of absolute lines: https://github.com/pypa/pip/blob/develop/pip/wheel.py#L506

@stonebig
Copy link
Contributor

stonebig commented Feb 2, 2016

ok, the absolute things are only at https://github.com/pypa/pip/blob/develop/pip/wheel.py#L520..L522

stonebig added a commit to stonebig/pip that referenced this issue Feb 2, 2016
RECORD now contains only relative path.
some bugs triggered by a bleeding edge usage of python may disappear a result (pypa#3433)
@PangKuo
Copy link

PangKuo commented Sep 12, 2016

I'm very happy that I resolved this issue.

Beacuse Devstack always install the relations with the certain version from config file.
For example, pip version come from /home/stack/devstack/tools/cap-pip.txt
if pip<8, the devstack will uninstall pip 8.1.2 and install pip 7.1.2. However, your program need pip 8.1.2, this bug come.

if you change pip<8 to pip<9, this issue will be resolved. But there will be more problems about version.

Actually, the main point is that, you write the wrong format in local.conf. Maybe your devstack version is kilo or liberty, but you fill your local.conf from openstack website, the config form website is for the latest version of devstack, that is different from other versions.

for example. the config about ceilometer
website:
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer

liberty:
enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api
enable_service ceilometer-alarm-notify ceilometer-alarm-eval
enable_service ceilometer-anotification

In a word, you should fill right config in local.conf for your devstack version, all the version problems will go away.

@xavfernandez
Copy link
Member

Closing this issue which seems to contain several issues.
#2382 might be a duplicate of the initial issue.
Feel free to reopen an other issue if some part is not solved in master.

@rgommers
Copy link
Author

the original issue indeed seems to be resolved now.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

5 participants