web-dev-qa-db-fra.com

Comment installer wxpython 4 Ubuntu 18.04

J'essaye d'installer le wxPython 4 sur ma machine Ubuntu 18.04.

Sudo pip isntall wxpython

Je reçois d'abord cet avertissement

    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.

et éventuellement erreur

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/

J'ai eu le même problème avec wxPython3 et la solution consistait à l'installer avec get

Sudo apt-get install python-wxgtk-3.0

J'ai également pu installer wxPython 4 pour Python3 mais pas python 2.7 ( instructions )

En outre, je suis très confus pourquoi il faut autant de temps CPU pour installer wxpython

Sudo pip install wxpython

see this image

3
Valentyn

Après avoir attendu assez longtemps, le processus était terminé et j'ai installé wxPython 4.

  • courir

    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

  • attendez un moment pour l'installer

après avoir terminé, vous verrez ce message.

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
Valentyn

D'abord je l'ai trouvé par:

Sudo apt search python3-wx

J'ai installé le dernier wxpython avec:

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

Vous pouvez aussi essayer synaptic de l’installer de cette façon si vous préférez.

0
Stan S.

Comme il existe différentes options pour la distro et le port wx (GTK2 ou GTK3), les fichiers ne peuvent pas tous être situés dans le même dossier pour un accès facile par pip. Cela signifie simplement que vous devrez approfondir un peu plus avant pour trouver l'URL à donner à pip. Par exemple, pour obtenir les versions GTK3 wxPython pour Ubuntu 18.04 (et 16.10, LinuxMint 18 et probablement d’autres), vous pouvez utiliser une commande pip comme celle-ci:

pip install -U\-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \wxPython

Bien sûr, vous pouvez toujours télécharger le fichier wheel vous-même, puis utiliser pip pour installer votre copie locale du fichier.

0

si quelqu'un a révisé cette erreur

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

essaye ça

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
GHOST