AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 881210
Accepted
alci
alci
Asked: 2017-02-09 06:13:47 +0800 CST2017-02-09 06:13:47 +0800 CST 2017-02-09 06:13:47 +0800 CST

使用 snapcraft 构建 python2 snap,python setup.py egg_info 错误

  • 772

编辑:似乎 setup.py 的目的是为 Mac OSX 生成一个带有py2app. 所以现在的问题是:如何防止 snapcraft python 插件调用 setup.py?

我正在尝试为 python 应用程序创建一个 snap,既要学习 snap,又因为这个应用程序仅作为 14.04 deb 包存在,它不会安装在我最近的系统上。请注意,我对 python 很陌生,对 snaps 完全陌生...

该应用程序是来自iramuteq.org 的Iramuteq

现有的 deb 包control文件如下所示:

Source: iramuteq
Standards-Version: 0.1.8
Section: science
Priority: extra
Maintainer: Pierre Ratinaud <[email protected]>
Build-Depends: debhelper (>= 7)
Homepage: http://www.iramuteq.org

Package: iramuteq
Architecture: all
Depends: python (>= 2.7), r-base (>= 3.0.0), python-wxgtk2.8 (>= 2.8), python-xlrd (>= 0.6), python-ooolib, r-cran-rgl (>= 0.79)
Description: Interface de R pour les analyses multidimensionnelles

所以,据我了解,我需要一些 python 库,我应该嵌入 r-cran-rgl 包。

这是snapcraft.yaml我想出的文件:

name: iramuteq # you probably want to 'snapcraft register <name>'
version: '0.7-alpha2' # just for humans, typically '1.2+git' or '1.3.2'
summary: R INTERFACE for multidimensional analysis of texts and questionnaires # 79 char long summary
description: |
  IRAMUTEQ is a GNU GPL (v2) licensed software that provides users with
  statistical analysis on text corpus and tables composed by individuals/words. 
  It is based on R software and on python language.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  iramuteq:
    command: iramuteq

parts:
  iramuteq:
    source: http://www.iramuteq.org/git/iramuteq
    source-type: git
    plugin: python
    python-version: 'python2'
    python-packages:
      - ooolib
      - xlrd
      - wxgtk2.8
    stage-packages:
      - r-base # (>= 3.0.0)
      - r-cran-rgl  #(>= 0.79)

运行snapcraft,我收到以下错误:

Processing /home/franck/iramuteq/snap/parts/iramuteq/src
  Link is a directory, ignoring download_dir
    Complete output from command python setup.py egg_info:
    warning: no directories found matching 'doc/_static'
    warning: no directories found matching 'doc/_templates'
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.dSYM' found anywhere in distribution
    warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
    warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
    no previously-included directories found matching 'examples/*/build'
    no previously-included directories found matching 'examples/*/dist'
    no previously-included directories found matching 'examples/*/*/build'
    no previously-included directories found matching 'examples/*/*/dist'
    no previously-included directories found matching 'examples/*/*/*/build'
    no previously-included directories found matching 'examples/*/*/*/dist'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-9UlL_H-build/setup.py", line 21, in <module>
        setup_requires=['py2app'],
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 317, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 851, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1123, in best_match
        return self.obtain(req, installer)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1135, in obtain
        return installer(requirement)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 440, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 674, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 700, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 881, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1120, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1108, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: This distribution is only supported on MacOSXdistuitls error.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-9UlL_H-build/

现在,我遇到了 distutils 错误……而且我也不确定 R 是否会(应该?)嵌入到我的 snap 中,或者安装在我的主系统上。

python
  • 1 1 个回答
  • 502 Views

1 个回答

  • Voted
  1. Best Answer
    user.dz
    2017-04-16T02:13:42+08:002017-04-16T02:13:42+08:00

    好吧,你已经plugin: python用 try to run 声明了 snapcraft setup.py。使用另一个插件,就像make那个项目有一个Makefile. 顺便说一句,make基本上是运行make; make install

    但是,在执行此操作之前,请检查debian/rules作为 Debian 源包的 makefile 的文件。看看他们是如何真正制作上一个版本的。

    更新:我刚刚检查了debian/rules文件,它包含手动安装命令。

    可能适用于您的情况的选项:

    1. dump(或已弃用copy)插件。

    2. 否则,请帮助上游项目也setup.py为 GNU/Linux 工作或添加Makefile.

    3. (可能是最佳选择)使用您喜欢的任何插件和自定义命令:插件-prepare:常用关键字build:install:

    建议包含所有需要的二进制文件(如 R),这样它就不会在更新和应用严格限制时中断。

    回答:

    首次运行时,应用程序使用 R 自己的包系统安装 R 插件。这可以用 Snap 处理吗?

    是的。

    • 如果这些包在构建时定义良好,选项 2 和 3 允许使用 R 命令安装并将它们包含在 snap 包中。

    • 如果这些包只能在运行时安装,则将 R 设置为使用 SNAP_COMMON或SNAP_DATA在部署后可写。snap 将核心安装为只读。

    可能还有其他选择,我仍在挖掘以了解 snap 的工作原理。

    • 1

相关问题

  • 默认的字符编码是什么?

  • 如何使用 pynotify 创建可点击通知?

  • 有没有安装 Django 1.2.*(最新稳定版)的简单方法?

  • 为 Python 应用程序设置构建系统

  • 为我的 PPA 创建包时遇到问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve