You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot find a explicit statement about how to cleanly uninstall packages that have been installed with python setup.py install. Some people suggest pip uninstall [package-name], but some people mention that issues can arise (see https://stackoverflow.com/questions/1550226/python-setup-py-uninstall). In my hands, the following happens:
$ sudo pip uninstall FlowCal
Uninstalling FlowCal-1.1.4:
/usr/local/lib/python2.7/dist-packages/FlowCal-1.1.4-py2.7.egg
Proceed (y/n)? y
Successfully uninstalled FlowCal-1.1.4
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 252, in main
pip_version_check(session)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/outdated.py", line 102, in pip_version_check
installed_version = get_installed_version("pip")
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 838, in get_installed_version
working_set = pkg_resources.WorkingSet()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 644, in __init__
self.add_entry(entry)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 700, in add_entry
for dist in find_distributions(entry, True):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1643, in load
mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/FlowCal-1.1.4-py2.7.egg'
File /usr/local/lib/python2.7/dist-packages/FlowCal-1.1.4-py2.7.egg is there before the uninstall command is executed, but not after. Everything looks like FlowCal has been successfully uninstalled after running this command (cannot import from the python prompt, pip install python from anywhere works, etc). So it seems like uninstalling is successful, it just raises that ugly error message, maybe from trying to delete that file twice.
However, if I install FlowCal with the following command:
Is there a better method for uninstalling packages installed with python setup.py install? I haven't found it but I'll keep looking.
If we don't find anything, pip install . seems to be a better installation method than python setup.py install in terms of cleanliness when uninstalling. Do we want to change our recommendation in the documentation? Do we want to change it in the Windows and OSX installation scripts?
The text was updated successfully, but these errors were encountered:
The posts I'm reading indeed endorse the use of pip (or, just generally some kind of package manager) over directly calling setup.py, so endorsing the use of a package manager seems like a good idea to me.
It looks like we're already kinda doing that in the documentation for manual installation? Might be nice to more clearly lay out our recommendation (i.e. "use a package manager", and then show them how), and only if a package manager is unavailable should you use python setup.py install. Maybe also put a Note/Warning in the documentation that if you install FlowCal via python setup.py install, you may have trouble uninstalling it (but again, we recommend using a package manager, even though it may throw errors).
I think pip is a good choice of package manager on Linux. I think it should work on OSX as well? Windows is a little trickier: I use Anaconda, which has its own package manager (conda). I believe you can still call pip in Anaconda (https://conda.io/docs/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages), but it might be a better idea to use conda if we can figure out how.
In the automated scripts, perhaps you can try to use pip (or conda, depending on system), and if that fails, default back to calling setup.py manually?
Should we add "Uninstall" scripts? My initial feeling is that we probably should if we want to be consistent about making the user experience as painless as possible.
I cannot find a explicit statement about how to cleanly uninstall packages that have been installed with
python setup.py install
. Some people suggestpip uninstall [package-name]
, but some people mention that issues can arise (see https://stackoverflow.com/questions/1550226/python-setup-py-uninstall). In my hands, the following happens:File
/usr/local/lib/python2.7/dist-packages/FlowCal-1.1.4-py2.7.egg
is there before the uninstall command is executed, but not after. Everything looks likeFlowCal
has been successfully uninstalled after running this command (cannotimport
from the python prompt,pip install python
from anywhere works, etc). So it seems like uninstalling is successful, it just raises that ugly error message, maybe from trying to delete that file twice.However, if I install FlowCal with the following command:
Uninstalling proceeds without any issues:
This was all done in Linux Mint 18.
So the following questions arise:
python setup.py install
? I haven't found it but I'll keep looking.pip install .
seems to be a better installation method thanpython setup.py install
in terms of cleanliness when uninstalling. Do we want to change our recommendation in the documentation? Do we want to change it in the Windows and OSX installation scripts?The text was updated successfully, but these errors were encountered: