stopping setup.py from installing as egg

风流意气都作罢 提交于 2019-11-30 01:10:23

I feel like I'm missing something subtle or important (encountering this page years after the question was asked and not finding a satisfying answer) however the following works fine for me:

python setup.py install --single-version-externally-managed --root=/

Compressed *.egg files are an invention of setuptools (I'm not a big fan of them although I understand why they were created) and because the setup.py script is using (and may require) setuptools, the package ends up being installed as a compressed *.egg file.

The command line options above are similar to those used by pip (the Python package manager) which hints at another way to stop a package from being installed as a compressed *.egg file: Just use pip! If you have a directory containing a setup.py script you can run the following command in that directory to install the package using pip:

pip install .

This is an improvement over the setup.py command above because it tracks additional metadata (e.g. tracking of installed files allows for more reliable removal).

Years later, same problem, not satisfied with the accepted answer. Found this in Google groups:

pushd /path/to/my/package/ 
python setup.py sdist 
popd 
pip install /path/to/my/package/dist/package-1.0.tar.gz

Explanation: python setup.py sdist creates a source distribution which naturally is not an *.egg! The resulting archive (.tar.gz in unix, .zip in windows) can be installed like any remote module with pip. It doesn't even require additional parameters! This results in the desired fully browsable module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!