During pbuilder build: run setup.py --install-layout=deb fails (no rights to write to /usr/lib/python2.7/dist-packages)

女生的网名这么多〃 提交于 2019-12-11 05:48:22

问题


I am trying to create PPA for PJSIP and would like to include the python-bindings.

I modified the Makefile, so that setup.py is called:

install:
     cd somefolder && python setup.py install --install-layout=deb

However, in the pbuilder environment it fails due to insufficient rights on /usr/lib/python2.7/dist-packages/

and I cannot use sudo (obviously)...

Suggestions?


回答1:


Your debian/rules install target must never install any files outside of the build tree. Instead, it should be installing to the package build directory (which, depending on how you're building the rest of the package, is probably debian/$packagename/. With a setup.py, the right switch to accomplish this is --root=debian/$packagename.

If you use dh_python2, dh_auto_install, and other debhelper tools appropriately, they will take care of that for you, plus a lot of other important housekeeping such as bytecompiling for various python installations on package install.



来源:https://stackoverflow.com/questions/17754968/during-pbuilder-build-run-setup-py-install-layout-deb-fails-no-rights-to-wri

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