Как установить wxpython 4 ubuntu 18.04

Я пытаюсь установить wxPython 4 на своей машине Ubuntu 18.04.

sudo pip isntall wxpython

Я получаю это предупреждение сначала

    The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

и в конечном счете ошибка

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-SyaTU1/wxpython/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-bzIjlK/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-SyaTU1/wxpython/

У меня была подобная проблема с wxPython3, и решение состояло в том, чтобы установить его с, добираются

sudo apt-get install python-wxgtk-3.0

Я также смог установить wxPython 4 для Python3, но не (инструкций) python 2.7

Кроме того, я очень смущен, почему требуется так много ЦП для установки wxpython

sudo pip install wxpython

see this image

4
задан 14 December 2018 в 08:17

4 ответа

После достаточно долго ждания процесса было завершено, и я установил wxPython 4.

  • выполненный

    sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
    
  • sudo pip install wxpython

  • ожидайте некоторое время, чтобы это установило

после завершения Вы будете видеть это сообщение.

The directory '/home/user-ii-6/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/home/user-ii-6/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting wxpython
  Downloading https://files.pythonhosted.org/packages/dd/31/bd55ab40e406a026a7fda0bb5eb61f466682544ae91ac26267c750f5e618/wxPython-4.0.3.tar.gz (68.5MB)
    100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 68.5MB 929kB/s 
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from wxpython) (1.11.0)
Requirement already satisfied: PyPubSub in ./.local/lib/python2.7/site-packages (from wxpython) (4.0.0)
Requirement already satisfied: typing in ./.local/lib/python2.7/site-packages (from PyPubSub->wxpython) (3.6.6)
Installing collected packages: wxpython
  Running setup.py install for wxpython ... done
Successfully installed wxpython-4.0.3
4
ответ дан 1 December 2019 в 09:12

если кто-либо пересмотрел эту ошибку

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main

попробуйте это

sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
sudo apt-get install python-wxgtk3.0
0
ответ дан 1 December 2019 в 09:12

С тех пор существуют различные варианты для дистрибутива и wx порта (GTK2 или GTK3) затем, файлы не могут все быть расположены в той же папке для легкого доступа зернышком. Это просто просто означает, что необходимо будет выполнить развертку немного далее, чтобы найти, что URL дает зернышку. Например, для получения сборок GTK3 wxPython для Ubuntu 18.04 (и 16.10 LinuxMint 18 и вероятно другие) можно использовать команду зернышка как это:

победите устанавливают-U \-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \wxPython

Конечно, можно всегда загружать файл колеса сами и затем использовать зернышко для установки локальной копии файла.

2
ответ дан 1 December 2019 в 09:12

Сначала я нашел его:

sudo apt search python3-wx

Я установил последний wxpython с:

sudo apt-get install python3-wxgtk4.0 python3-wxgtk-webview4.0 python3-wxgtk-media4.0

Можно также попробовать синаптический для установки его тот путь, если Вы предпочитаете.

1
ответ дан 1 December 2019 в 09:12

Другие вопросы по тегам:

Похожие вопросы: