When would the -e, --editable option be useful with pip install?

前端 未结 4 676
悲哀的现实
悲哀的现实 2020-11-29 00:07

When would the -e, or --editable option be useful with pip install?

For some projects the last line in requirements.txt is

4条回答
  •  醉梦人生
    2020-11-29 00:49

    It is important to note that pip uninstall can not uninstall a module that has been installed with pip install -e. So if you go down this route, be prepared for things to get very messy if you ever need to uninstall. A partial solution is to (1) reinstall, keeping a record of files created, as in sudo python3 -m setup.py install --record installed_files.txt, and then (2) manually delete all the files listed, as in e.g. sudo rm -r /usr/local/lib/python3.7/dist-packages/tdc7201-0.1a2-py3.7.egg/ (for release 0.1a2 of module tdc7201). This does not 100% clean everything up however; even after you've done it, importing the (removed!) local library may succeed, and attempting to install the same version from a remote server may fail to do anything (because it thinks your (deleted!) local version is already up to date).

提交回复
热议问题