Build a wheel/egg and all dependencies for a python project

≯℡__Kan透↙ 提交于 2019-11-28 15:53:56

You will need to create a setup.py file for your package. Make sure you have the latest setuptools and pip installed. Then run the following:

python setup.py bdist_wheel

This will create a wheel file for your package. This assumes you don't have C/C++ headers, DLLs, etc. If you do, then you'll probably have a lot more work to do.

To get dependencies, you will want to create a requirements.txt file and run the following:

pip wheel -r requirements.txt

If your package isn't on PyPI, then you'll have to manually copy your package's wheel file into the wheel folder that this command creates. For more information see the following excellent article:

With the latest pip and wheel, you can simply run

pip wheel .

within your project folder, even if your application isn't on PyPi. All wheels will be stored in ./wheelhouse. When I tried it, though, it missed one of my dependencies and I needed to manually build it. Not sure why.

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