簡體   English   中英

如何在Ubuntu 14.10的Python 2.7 virtualenv中安裝wxPython 3.0.1.1?

[英]How can I install wxPython 3.0.1.1 in Python 2.7 virtualenv on Ubuntu 14.10?

以下過程失敗。 我錯過了什么嗎?

  • 安裝各種Ubuntu軟件包(編譯的先決條件)
  • 獲取http://downloads.sourceforge.net/wxpython/wxPython-src-3.0.1.1.tar.bz2
  • 解壓縮到wxPython-src-3.0.1.1/
  • 創建名為test新virtualenv
  • 激活test virtualenv
  • 在終端中,從wxPython-src-3.0.1.1/

     ./configure --prefix=/home/username/.virtualenvs/test --with-gtk2 --enable-unicode --with-opengl #lots of output, confirms "Configured wxWidgets 3.0.1 for `x86_64-unknown-linux-gnu'" make install #lots of output, confirms: # The installation of wxWidgets is finished. On certain # platforms (eg Linux) you'll now have to run ldconfig # if you installed a shared library and also modify the # LD_LIBRARY_PATH (or equivalent) environment variable. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.virtualenvs/test/lib # don't run ldconfig since that is a system tool, not appropriate for virtualenv? cd wxPython python setup.py install # lots of output, starting: # WARNING: WXWIN not set in environment. Assuming '..' # Found wx-config: /home/username/.virtualenvs/test/bin/wx-config # Using flags: --toolkit=gtk2 --unicode=yes --version=3.0 # Preparing CORE... # Preparing STC... # Preparing GLCANVAS... # Preparing GIZMOS... # running install # etc 

最終命令失敗:

src/gtk/_core_wrap.cpp:20407:7: note: ‘arg3’ was declared here
   int arg3 ;
       ^
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Image_SetAlphaBuffer(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:3747:13: warning: ‘arg3’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (ALPHASIZE != self->GetWidth() * self->GetHeight()) {
             ^
src/gtk/_core_wrap.cpp:20474:7: note: ‘arg3’ was declared here
   int arg3 ;
       ^
cc1plus: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我使用python setup.py install &> ~/error.txt將錯誤消息傳遞給知識淵博的同事,后者確認C編譯使用-Werror=format-security標志。 此版本的wxPython(可能還有其他版本)無法使用該標志進行編譯。

我的$CPPFLAGS$CFLAGS環境變量都是空的。 事實證明,此標志由hardening-wrapper觸發。

因此,我通過如下所示的最后一步覆蓋了該標志,並且成功安裝了wxPython:

CFLAGS=-Wno-error=format-security CPPFLAGS=-Wno-error=format-security python setup.py install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM