无法安装新的wxpython

时间:2017-11-12 08:37:54

标签: python wxpython gstreamer wxpython-phoenix

我正在使用Debian Stable Linux和python 3.5,我正在尝试使用以下命令安装新的wxpython(phoenix):

import openpyxl,os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime
import pandas_datareader as pdr
from scipy.stats import linregress

start = datetime.datetime(2010,1,1)
end = datetime.datetime(2017,11,10)
i = NSE/CHENNPETRO
df = pdr.DataReader(i, 'quandl', start, end)
# df = df.iloc[::-1]
linregress(df.index,df['Close'])

然而,它会因以下错误而停止:

pip3 install --upgrade wxpython

我安装了以下与gstreamer相关的软件包:

  checking for CAIRO... yes
    checking for cairo_push_group... yes
    checking for GST... configure: WARNING: GStreamer 1.0 not available, falling back to 0.10
    checking for GST... configure: WARNING: GStreamer 0.10 not available, falling back to 0.8
    configure: error: GStreamer not available
    Error running configure
    ERROR: failed building wxWidgets
    Traceback (most recent call last):
      File "build.py", line 1269, in cmd_build_wx
        wxbuild.main(wxDir(), build_options)
      File "/tmp/pip-build-pdn9eo0c/wxpython/buildtools/build_wxwidgets.py", line 376, in main
        "Error running configure")
      File "/tmp/pip-build-pdn9eo0c/wxpython/buildtools/build_wxwidgets.py", line 85, in exitIfError
        raise builder.BuildError(msg)
    buildtools.builder.BuildError: Error running configure
    Finished command: build_wx (0m9.685s)
    Finished command: build (0m9.686s)
    Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.

我需要安装哪些其他gstreamer包?谢谢你的帮助。

2 个答案:

答案 0 :(得分:7)

我发现在Ubuntu 16.04上安装wxPython的唯一方法是执行以下命令:

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

如果你只是执行通常的

sudo pip install wxPython

然后它会失败抱怨GStreamer丢失(但我安装了所有必需的软件包,当然)。

答案 1 :(得分:0)

here及以上所述,pip不会帮助您(除非您直接from sources构建东西)。

虽然已经有很多可用的二进制文件,但笑话是操作系统提供的二进制文件仅适用于python 2.7,而官方开发团队提供的二进制文件不适用于i386。

非常感谢我认为是wx开发人员之一,在测试过程中对set up a PPA表示了礼貌。而且我认为Xenial和Stretch之间应该没有special不兼容,因为它们共享相同的东西最终成为python3版本(甚至有a newer one,但它颠覆了sip-py3api-11.2依赖关系,而其他一些软件包可能很难做到这一点)

<ol class="row top20" id="my_list">
</ol>

<script>
$(function () {
    'use strict';

    const randomSearchMatchPercentages = array => {
        let index = 0;
        let results = [];

        for (const element of array) {
            // define a maximum and a minimum range
            const maximum = index <= 100 ? 100 - index : 0;
            const minimum = maximum > 0 ? maximum - 5 : 0;

            element.match = Math.round( Math.random() * ( maximum - minimum ) + minimum ) + "%";
            results.push(element);

            // decrease the maximum and minimum for the next iteration
            index += 5;
        }
        return results;
    }

    $.get("/matching_score_data", function(data) {
        // randomSearchMatchPercentages function in here...
        const results = randomSearchMatchPercentages(data);

        // now, to show the list you need to manipulate
        // the DOM appending the elements inside the
        // #my_list ol element
        for (let i = 0; i < data.length; i++) {
            $("#my_list ol").append(`
                <li class="list-item">
                    <div class="showcase col-sm-6 col-md-4">
                        <a href="${results[i].url}">
                            <h3>${results[i].title}</h3>
                            <p>${results[i].match}</p>
                            <img src="${results[i].image}" class="img-responsive">
                        </a>
                    </div>
                </li>
            `);
        }
    });
});
</script>