1

Я пытался установить beeware в моей системе, используя pip install beeware, но всегда не получалось. Вот весь след. Вот ссылка на всю трассировку для лучшей читабельности.

 copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.6/gi/overrides
  running build_ext
  pycairo: new API
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1241, in <module>
      main()
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1236, in main
      zip_safe=False,
    File "/home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/setuptools/__init__.py", line 143, in setup
      return distutils.core.setup(**attrs)
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1076, in run
      self._setup_extensions()
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1071, in _setup_extensions
      add_pycairo(gi_cairo_ext)
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1055, in add_pycairo
      ext.include_dirs += [get_pycairo_include_dir()]
    File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 877, in get_pycairo_include_dir
      include_dir = find_path(find_new_api())

  File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 822, in find_new_api
      import cairo
  ModuleNotFoundError: No module named 'cairo'

  ----------------------------------------
  Failed building wheel for pygobject
  Running setup.py clean for pygobject
  Running setup.py bdist_wheel for arrow ... done
  Stored in directory: /home/apoorv/.cache/pip/wheels/1e/d5/30/cace6155de216c74f70b1b866ce6ec2c9bbc60be88073a1fcd
Successfully built arrow
Failed to build pygobject
Installing collected packages: gbulb, pycairo, pygobject, travertino, toga-core, toga-gtk, toga, voc, idna, urllib3, chardet, certifi, requests, jmespath, six, python-dateutil, docutils, botocore, s3transfer, boto3, whichcraft, arrow, MarkupSafe, jinja2, jinja2-time, poyo, binaryornot, future, click, cookiecutter, briefcase, beeware
  Running setup.py install for pygobject ... error
    Complete output from command /home/apoorv/Desktop/classes_py/beeware_py/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ozyu2ccy/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-4ds5h09_/install-record.txt --single-version-externally-managed --compile --install-headers /home/apoorv/Desktop/classes_py/beeware_py/include/site/python3.6/pygobject:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/pygtkcompat
    copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.6/pygtkcompat
    copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.6/pygtkcompat
    copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.6/pygtkcompat
    creating build/lib.linux-x86_64-3.6/gi
    copying gi/_compat.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/docstring.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/module.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_option.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_error.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/__init__.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/types.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/importer.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_constants.py -> build/lib.linux-x86_64-3.6/gi
    creating build/lib.linux-x86_64-3.6/gi/repository
    copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.6/gi/repository
    creating build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/GdkPixbuf.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.6/gi/overrides
    running build_ext
    pycairo: new API
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1241, in <module>
        main()
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1236, in main
        zip_safe=False,
      File "/home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/setuptools/__init__.py", line 143, in setup
        return distutils.core.setup(**attrs)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/apoorv/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1076, in run
        self._setup_extensions()
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1071, in _setup_extensions
        add_pycairo(gi_cairo_ext)
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 1055, in add_pycairo
        ext.include_dirs += [get_pycairo_include_dir()]
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 877, in get_pycairo_include_dir
        include_dir = find_path(find_new_api())
      File "/tmp/pip-install-ozyu2ccy/pygobject/setup.py", line 822, in find_new_api
        import cairo
      File "/home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/cairo/__init__.py", line 1, in <module>
        from ._cairo import *  # noqa: F401,F403
    ImportError: /home/apoorv/Desktop/classes_py/beeware_py/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_svg_surface_set_document_unit

    ----------------------------------------
Command "/home/apoorv/Desktop/classes_py/beeware_py/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ozyu2ccy/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-4ds5h09_/install-record.txt --single-version-externally-managed --compile --install-headers /home/apoorv/Desktop/classes_py/beeware_py/include/site/python3.6/pygobject" failed with error code 1 in /tmp/pip-install-ozyu2ccy/pygobject/

Вопрос уже открыт по этому поводу, но это мало помогло. Я использую Python 3.6 на машине Ubuntu 18.04. Кажется, мне нужно установить базовые двоичные библиотеки, а затем обертки Python. Но я не могу понять, как это исправить. Что я должен сделать, чтобы это исправить?

1 ответ1

0
  1. У меня была похожая проблема при установке скрапа. В моем случае почти такая же ошибка произошла с витой упаковкой.

    Запуск setup.py install для pygobject ... ошибка

В моем случае помогли установить пакеты:

sudo apt-get install python3-setuptools
sudo apt-get install python3-dev
  1. Я также пытался установить beeware. В первый раз это не сработало, но я получил рекомендацию по установке:

    sudo apt установить libgirepository1.0-dev

И после этого можно было установить beeware.

  1. Может быть, это поможет установить в режиме root:

    sudo -s cd virtualenv_directory/bin/ #only, если установка в источнике виртуальной среды, активировать #only, если установка в виртуальной среде. pip3 установить, будьте осторожны

Моя система - Linux Mint 19 (она основана на Ubuntu 18.04 - так же, как и у вас), и я установил ее с Python 3.6.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .