如何在Ubuntu 18.04上安装wxPython 2.8?

jdgnovmf  于 2022-12-02  发布在  Python
关注(0)|答案(5)|浏览(285)

我正在尝试在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

ar7v8xwq

ar7v8xwq1#

由于发行版和wx端口有多种选择(GTK 2或GTK 3),那么这些文件不能都位于同一个文件夹中,以便pip访问。这只是意味着您需要进一步深入,以找到pip的URL。例如,要获得Ubuntu 18.04的GTK 3 wxPython构建版本(以及16.10、LinuxMint 18,可能还有其他版本)您可以使用如下pip命令:
pip安装-U \ -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04\ wxPython
当然,您可以随时自己下载wheel文件,然后使用pip安装该文件的本地副本。

fv2wmkja

fv2wmkja2#

https://extras.wxpython.org/wxPython4/extras/开始
只需打开终端并执行以下操作:
网址= https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04
pip安装-U -f $URL wxPython
这对我有用!

ubof19bj

ubof19bj3#

这可能会帮助您:

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
krcsximq

krcsximq4#

我在一个xterminal中使用了这个方法,以便在synaptic中包含trusty repository。

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

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

zour9fqk

zour9fqk5#

在等待了足够长的时间后,这个过程完成了,我安装了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

相关问题