在pbuilder构建期间:运行setup.py --install-layout = deb失败(无权写入/usr/lib/python2.7/dist-packages) [英] During pbuilder build: run setup.py --install-layout=deb fails (no rights to write to /usr/lib/python2.7/dist-packages)

查看:410
本文介绍了在pbuilder构建期间:运行setup.py --install-layout = deb失败(无权写入/usr/lib/python2.7/dist-packages)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为PJSIP创建PPA,并希望包含python-bindings。



我修改了Makefile,所以setup.py被调用: / p>

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

然而,在 pbuilder 环境,由于/usr/lib/python2.7/dist-packages /



的权限不足,我无法使用sudo(显然)...



建议?

解决方案

您的debian /在构建树之外安装任何文件。相反,它应该是安装到包构建目录(根据你如何构建包的其余部分,可能是 debian / $ packagename / 。 setup.py,正确的切换是 - root = debian / $ packagename



如果你使用dh_python2,dh_auto_install和其他debhelper工具,他们会为您处理,加上很多其他重要的内务管理,例如在程序包安装上为各种python安装进行编译。


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?

解决方案

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.

这篇关于在pbuilder构建期间:运行setup.py --install-layout = deb失败(无权写入/usr/lib/python2.7/dist-packages)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆