wonky pth file breaks upgrade
See original GitHub issuenstalling collected packages: pbr, pip
Found existing installation: pbr 0.10.0
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
Cannot remove entries from nonexistent file /home/robertc/work/openstack/oslo.config/easy-install.pth
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1431, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 555, in uninstall
paths_to_remove.add_pth(easy_install_pth, './' + easy_install_egg)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1785, in add_pth
self.pth[pth_file] = UninstallPthEntries(pth_file)
File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1868, in __init__
raise UninstallationError("Cannot remove entries from nonexistent file %s" % pth_file)
UninstallationError: Cannot remove entries from nonexistent file /home/robertc/work/openstack/oslo.config/easy-install.pth
Issue Analytics
- State:
- Created 8 years ago
- Comments:24 (7 by maintainers)
Top Results From Across the Web
pth file not migrated after Python version upgrade
Every time I upgrade to a newer Python version, my implementation breaks until I manually copy the .pth file to the new site-packages ......
Read more >Saving and loading models for inference in PyTorch
A common PyTorch convention is to save models using either a .pt or .pth file extension. Notice that the load_state_dict() function takes a...
Read more >Issue 33944: Deprecate and remove code execution in pth files
msg320246 ‑ (view) Author: Barry A. Warsaw (barry) * Date: 2018‑06‑22 17:22
msg320249 ‑ (view) Author: Christian Heimes (christian.heimes) * Date: 2018‑06‑22 18:05
msg320253 ‑...
Read more >NCO 5.1.4-alpha01 User Guide - NCO netCDF Operators
Cut out extraneous variables, dimensions, and metadata from the offending files and re-run the command until it no longer breaks. Then back up...
Read more >TOXICOLOGICAL PROFILE FOR POLYCYCLIC AROMATIC ...
For information regarding the update status of previously released ... PAHs can break down to longer-lasting products by reacting with sunlight and other....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I tried filing this as an anaconda bug, but @ilanschnell closed it as a setuptools/pip issue. I’m including a summary of the discussion here:
Setup
The bug
Trying to
install -Uany package depending on setuptools also fails with the same error.Known workarounds
Adding the
--ignore-installedoption will sucessfully upgrade setuptools and the problem will be solved for the lifetime of that particular conda environment. Downloading and running ez_setup.py also fixes the problem for that conda environment. The second workaround will create the missing pth file, while the first will not, but in both cases everything seems to work afterwards.While using
condato upgrade setuptools is also a workaround, it is not a good solution, since a lot of packages on pypi (1822 in 2013) depend on setuptools and therefore try to upgrade setuptools too, when upgraded:A lot of pypi packages are not installable using
conda install, and so using conda to upgrade these is not an option.None of these workarounds are good permanent solutions to this bug because:
-Ifixes the problem and will have to spend a considerable amount of time searching for some solution.Cause
The error message is correct, there is no easy-install.pth file in site-packages. The error occurs when pip tries to uninstall the old setuptools package, in pip/req/req_uninstall.py:160. The file pip is trying to remove (easy-install.pth) does not exist in a fresh Anaconda/Miniconda installation because no conda packages are able to include this file.
This is a periodically sleeping bug, since it rears its head whenever the conda setuptools version (currently 18.8.1) lags behind the pip setuptools version (currently 19.1.1).
The assumption of easy-install.pth file is guarded by a check for .egg:
So my guess is that your conda package looks like an easy_install egg: this may confuse other tools as well. Perhaps don’t do that?