首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用dh-virtualenv构建Debian包?不使用fakeroot的规则文件

如何使用dh-virtualenv构建Debian包?不使用fakeroot的规则文件
EN

Stack Overflow用户
提问于 2016-08-23 02:28:55
回答 1查看 1.9K关注 0票数 0

我正在尝试用Spotify的dh-virtualenv debian包助手构建一个deb包。

运行时得到的错误消息:dpkg-buildpackage -us -uc

代码语言:javascript
复制
(venv) $ dpkg-buildpackage -us -uc
dpkg-buildpackage: source package ese-xlr8r
dpkg-buildpackage: source version 1.4.7
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Special Characters <casDTV_SpecChars@echostar.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build active
 fakeroot debian/rules clean
: No such file or directory
'.  Stop. No rule to make target `
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2

我不知道为什么它找不到规则文件。我可以在不使用fakeroot的情况下手动运行该文件,并且它可以工作(或者至少它传递了初始错误):

代码语言:javascript
复制
: command not found
: no such job
   dh_testdir
   dh_auto_clean
pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
/home/echostar/projects/XLR8R/active/venv/local/lib/python2.7/site-packages/setuptools/dist.py:364: UserWarning: Normalizing '1.4.10
' to '1.4.10'
  normalized_version,
running clean
'build/lib.linux-x86_64-2.7' does not exist -- can't clean it
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
   dh_clean

因为您没有看到“没有这样的文件或目录”错误。我可以用fakeroot再现错误:

代码语言:javascript
复制
(venv) $ fakeroot debian/rules
: No such file or directory
'.  Stop. No rule to make target `

这是我的规则文件:

代码语言:javascript
复制
(venv) $ cat debian/rules
#!/usr/bin/make -f

%:
      dh $@ --with python-virtualenv

我是不是遗漏了什么?

注意:'venv‘是我的virtualenv的名称,是活动的。

更新08/23/2016我将我的代码复制到数据中心中的另一个VM中,使用稍微老一点的Ubuntu并重新安装所有东西,并运行buildpackage命令。这一次,它做了更多的,但在最后仍然类似的错误。我不会发布整个构建包日志,但最后的要点是:

代码语言:javascript
复制
New python executable in debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python
Installing setuptools, pip...done.
Downloading/unpacking behave==1.2.5 (from -r ./requirements.txt (line 1))
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement behave==1.2.5 (from -r ./requirements.txt (line 1))
Cleaning up...
No distributions at all found for behave==1.2.5 (from -r ./requirements.txt (line 1))
Storing debug log for failure in /home/echostar/.pip/pip.log
Traceback (most recent call last):
  File "/usr/bin/dh_virtualenv", line 106, in <module>
    sys.exit(main() or 0)
  File "/usr/bin/dh_virtualenv", line 86, in main
    deploy.install_dependencies()
  File "/usr/lib/python2.7/dist-packages/dh_virtualenv/deployment.py", line 172, in install_dependencies
    subprocess.check_call(self.pip('-r', requirements_path))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python', '/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/pip', 'install', '--log=/tmp/tmpNybuqh', '-r', './requirements.txt']' returned non-zero exit status 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2

我不知道它为什么要调用带有python前缀的pip,比如: python安装-r ./quiments.txt

Pip不是这样调用的python文件。可能是dh-virtualenv中的错误?

EN

回答 1

Stack Overflow用户

发布于 2016-10-13 22:43:30

在构建Python时,pip无法满足项目的依赖关系之一:

没有为behave==1.2.5找到任何发行版

它将被列在项目的requirements.txt文件中。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39091405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档