如何在Ubuntu 18.04上安装wxPython 2.8?

时间:2018-09-06 08:24:34

标签: python ubuntu wxpython robotframework

我正在尝试在Ubuntu 18.04系统上安装wxPython 2.8。但是它失败并显示以下错误:

$ sudo apt install python-wxgtk2.8
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-wxgtk2.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-wxgtk2.8' has no installation candidate

让我知道如何解决以上错误,以便我可以安装wxPython 2.8

5 个答案:

答案 0 :(得分:0)

等待了足够长的时间后,过程完成,我安装了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
  • 等待一会儿安装

完成后,您将看到此消息。

当前用户不拥有目录'/home/user-ii-6/.cache/pip/http'或其父目录,并且缓存已被禁用。请检查该目录的权限和所有者。如果使用sudo执行pip,则可能需要sudo的-H标志。

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

答案 1 :(得分:0)

由于发行版和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-16.04 \     wxPython

当然,您始终可以自己下载wheel文件,然后使用pip安装文件的本地副本。

答案 2 :(得分:0)

来自https://extras.wxpython.org/wxPython4/extras/

只需打开终端并执行:

URL = https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04

pip install -U -f $ URL wxPython

这对我有用!

答案 3 :(得分:0)

这可能会帮助您

sudo echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
sudo apt get update
sudo apt-get install python-wxgtk2.8

答案 4 :(得分:-1)

我在xterminal中使用了它,以便在突触中包含可信任的存储库。

echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list

之后,在Synaptic-packagemanager中重新加载存储库,然后安装它。 确保取消选择存储库(在“设置”下的“存储库”“其他存储库”下),这样您就不会从该旧存储库中安装过时的软件