web-dev-qa-db-ja.com

wxpython 4 ubuntu 18.04のインストール方法

Ubuntu 18.04マシンにwxPython 4をインストールしようとしています。

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で同様の問題があり、解決策はgetでインストールすることでした

Sudo apt-get install python-wxgtk-3.0

Python3用のwxPython 4もインストールできましたが、python 2.7はインストールできませんでした( instructions

また、なぜwxpythonをインストールするのに多くのCPUが必要なのか、私は非常に混乱しています

Sudo pip install wxpython

see this image

3
Valentyn

十分に長く待った後、プロセスが完了し、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
Valentyn

最初に私はそれを見つけました:

Sudo apt search python3-wx

最新のwxpythonをインストールしました:

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

必要に応じて、synapticを試してその方法でインストールすることもできます。

0
Stan S.

Distroおよびwxポート(GTK2またはGTK3)にはさまざまなオプションがあるため、pipで簡単にアクセスできるように、ファイルをすべて同じフォルダーに配置することはできません。これは単に、pipに渡すURLを見つけるためにもう少しドリルダウンする必要があることを意味します。たとえば、Ubuntu 18.04(および16.10、LinuxMint 18、およびおそらくその他)のGTK3 wxPythonビルドを取得するには、次のようなpipコマンドを使用できます。

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

もちろん、ホイールファイルはいつでも自分でダウンロードしてから、pipを使用してファイルのローカルコピーをインストールできます。

0

誰かがこのエラーを修正した場合

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
GHOST