AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1073145
Accepted
Valentyn
Valentyn
Asked: 2018-09-08 08:49:38 +0800 CST2018-09-08 08:49:38 +0800 CST 2018-09-08 08:49:38 +0800 CST

如何安装 wxpython 4 ubuntu 18.04

  • 772

我正在尝试在我的 Ubuntu 18.04 机器上安装 wxPython 4。

sudo pip install 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

我还能够为 Python 3 安装 wxPython 4,但不能为 Python 2.7 安装(说明)

另外,我很困惑为什么安装 wxpython 需要这么多 CPU

sudo pip install wxpython

看到这张图片

command-line python wxpython
  • 4 4 个回答
  • 21721 Views

4 个回答

  • Voted
  1. Best Answer
    Valentyn
    2018-09-08T10:32:42+08:002018-09-08T10:32:42+08:00

    等待足够长的时间后,该过程已完成,我安装了 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或者sudo pip3 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
    
    • 14
  2. Nitai Bhattacharyya
    2019-04-13T23:19:16+08:002019-04-13T23:19:16+08:00

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

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

    • 3
  3. Stan S.
    2019-06-27T23:53:20+08:002019-06-27T23:53:20+08:00

    首先,我通过以下方式找到了它:

    sudo apt search python3-wx
    

    我安装了最新的 wxpython:

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

    如果您愿意,您也可以尝试以这种方式安装突触。

    • 2
  4. GHOST
    2018-12-14T21:13:44+08:002018-12-14T21:13:44+08:00

    如果有人修改了这个错误

    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

相关问题

  • 如何从命令行仅安装安全更新?关于如何管理更新的一些提示

  • 如何从命令行刻录双层 dvd iso

  • 如何从命令行判断机器是否需要重新启动?

  • 文件权限如何工作?文件权限用户和组

  • 如何在 Vim 中启用全彩支持?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve