I recently upgraded from Ubuntu 17.04 to 17.10 in order to be able receive the patches for meltdown. This upgrade automatically bumped me from python3.5 to python3.6, which I don't have any problem with. However, I do have to go through and reinstall all the little tools I used. One is being troublesome.
I use a tool called tmuxp, and the official install instructions are pip install --user tmuxp
. However, it seems that some time ago I install tmuxp globally on my python3.5, and it now has an executable in my /user/local/bin
:
➜ maynard@buddha ~ which tmuxp
/usr/local/bin/tmuxp
This means that even after running pip install --user tmuxp
, when I run tmuxp
I get a DistributionNotFound
error.
➜ maynard@buddha ~ tmuxp
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 972, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 863, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (tmuxp 1.3.5 (/home/maynard/.local/lib/python3.6/site-packages), Requirement.parse('tmuxp==1.3.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/tmuxp", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3049, in <module>
@_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 660, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'tmuxp==1.3.2' distribution was not found and
is required by the application
So the old python3.5 tmuxp binary is going and looking in the new python3.6 site-packages for an older version of itself. This should be an easy fix. Simply uninstall the python3.5 version of tmuxp. But when I use pip3.5
is tries to uninstall the python3.6 tmuxp.
pip3.5 uninstall tmuxp
Uninstalling tmuxp-1.3.5:
/home/maynard/.local/bin/tmuxp
/home/maynard/.local/lib/python3.6/site-packages/tmuxp-1.3.5.dist-info/DESCRIPTION.rst
...
/home/maynard/.local/lib/python3.6/site-packages/tmuxp/workspacebuilder.py
In fact, a pip3.5
list doesn't even show tmuxp
, but I can see it in /usr/local/lib/python3.5/dist-packages
!
ls /usr/local/lib/python3.5/dist-packages
click kaptan powerline
click-6.7.dist-info kaptan-0.5.8.egg-info powerline_status-2.6.egg-info
colorama libtmux tmuxp
colorama-0.3.9.dist-info libtmux-0.7.4.egg-info tmuxp-1.3.2.egg-info
Invoking sudo
doesn't work either. sudo ~/.local/bin/pip3.5 uninstall tmuxp
once again tries to uninstall the python3.6 version of tmuxp.
I know I could just delete the binary in /usr/local/bin/tmuxp
... But I want to know how I got myself into this mess and how I can get out of it cleanly.