python - 无法在 MacOS 上 pip 安装 scikits.talkbox

标签 python macos python-3.7 scikits

我正在尝试在我的 MacOS 上 pip install scikits.talkbox。我使用Python 3.7.3

如果我运行

pip install scikits.talkbox

pip3 install scikits.talkbox

我收到以下错误(我希望我确实包含了所有内容)

scikits/talkbox/tools/src/cffilter.c:3287:21: error: no member named 'exc_type' in 'struct _ts'
    *type = tstate->exc_type;
            ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3288:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    *value = tstate->exc_value;
                     ^~~~~~~~~
                     curexc_value
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
    PyObject *curexc_value;
              ^
scikits/talkbox/tools/src/cffilter.c:3289:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
    *tb = tstate->exc_traceback;
                  ^~~~~~~~~~~~~
                  curexc_traceback
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
    PyObject *curexc_traceback;
              ^
scikits/talkbox/tools/src/cffilter.c:3298:24: error: no member named 'exc_type' in 'struct _ts'
    tmp_type = tstate->exc_type;
               ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3299:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    tmp_value = tstate->exc_value;
                        ^~~~~~~~~
                        curexc_value
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
    PyObject *curexc_value;
              ^
scikits/talkbox/tools/src/cffilter.c:3300:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
    tmp_tb = tstate->exc_traceback;
                     ^~~~~~~~~~~~~
                     curexc_traceback
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
    PyObject *curexc_traceback;
              ^
scikits/talkbox/tools/src/cffilter.c:3301:13: error: no member named 'exc_type' in 'struct _ts'
    tstate->exc_type = type;
    ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3302:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    tstate->exc_value = value;
            ^~~~~~~~~
            curexc_value
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
    PyObject *curexc_value;
              ^
scikits/talkbox/tools/src/cffilter.c:3303:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
    tstate->exc_traceback = tb;
            ^~~~~~~~~~~~~
            curexc_traceback
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
    PyObject *curexc_traceback;
              ^
scikits/talkbox/tools/src/cffilter.c:3319:24: error: no member named 'exc_type' in 'struct _ts'
    tmp_type = tstate->exc_type;
               ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3320:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    tmp_value = tstate->exc_value;
                        ^~~~~~~~~
                        curexc_value
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
    PyObject *curexc_value;
              ^
scikits/talkbox/tools/src/cffilter.c:3321:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
    tmp_tb = tstate->exc_traceback;
                     ^~~~~~~~~~~~~
                     curexc_traceback
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
    PyObject *curexc_traceback;
              ^
scikits/talkbox/tools/src/cffilter.c:3322:13: error: no member named 'exc_type' in 'struct _ts'
    tstate->exc_type = *type;
    ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3323:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    tstate->exc_value = *value;
            ^~~~~~~~~
            curexc_value
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
    PyObject *curexc_value;
              ^
scikits/talkbox/tools/src/cffilter.c:3324:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
    tstate->exc_traceback = *tb;
            ^~~~~~~~~~~~~
            curexc_traceback
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
    PyObject *curexc_traceback;
              ^
scikits/talkbox/tools/src/cffilter.c:3537:25: warning: implicit declaration of function 'PyNumber_Int' is invalid in C99 [-Wimplicit-function-declaration]
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
                        ^
scikits/talkbox/tools/src/cffilter.c:3537:19: warning: incompatible integer to pointer conversion initializing 'PyObject *' (aka 'struct _object *') with an expression of type 'int' [-Wint-conversion]
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
                  ^     ~~~~~~~~~~~~~~~
scikits/talkbox/tools/src/cffilter.c:3558:25: warning: implicit declaration of function 'PyNumber_Int' is invalid in C99 [-Wimplicit-function-declaration]
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
                        ^
scikits/talkbox/tools/src/cffilter.c:3558:19: warning: incompatible integer to pointer conversion initializing 'PyObject *' (aka 'struct _object *') with an expression of type 'int' [-Wint-conversion]
        PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
                  ^     ~~~~~~~~~~~~~~~

我怀疑是setuptools有问题,我刚刚升级了,没有结果。有什么想法吗?

最佳答案

我在 macOS 上的 Python 3.7.4 上遇到了同样的错误。与包的Cython相关代码有关:

scikits/talkbox/tools/src/cffilter.c:3287:21: error: no member named 'exc_type' in 'struct _ts'
    *type = tstate->exc_type;
            ~~~~~~  ^
scikits/talkbox/tools/src/cffilter.c:3288:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    *value = tstate->exc_value;
                     ^~~~~~~~~
                     curexc_value

首先,scikits.talkbox该软件包非常古老,其最后一次发布waaaaay是在 2009 年 8 月 28 日(参见 0.25 ),大约是 10 年前!它似乎与 Python 3 不兼容,甚至还没有移植。

不过,它确实在 Python 2.7 上安装成功:

$ python -V
Python 2.7.16
$ python -m pip install numpy scipy
...
$ python -m pip install scikits.talkbox
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting scikits.talkbox
  Using cached https://files.pythonhosted.org/packages/65/a0/410eb932e1765186a4728d1c9b28410695d554c47439bcb69a407d5d3921/scikits.talkbox-0.2.5.tar.gz
Requirement already satisfied: numpy in /Users/cerberus/.virtualenvs/test-py27/lib/python2.7/site-packages (from scikits.talkbox) (1.16.5)
Building wheels for collected packages: scikits.talkbox
  Building wheel for scikits.talkbox (setup.py) ... done
  Created wheel for scikits.talkbox: filename=scikits.talkbox-0.2.5-cp27-cp27m-macosx_10_13_x86_64.whl size=68422 sha256=4585d129fe5ba2de97935f723f2d84a8b908480528c66cf00714f8a5f56c6bee
  Stored in directory: /Users/cerberus/Library/Caches/pip/wheels/40/06/3f/05c8ab2b4a0cfb32ad02c449e5c949c592cd0c6458db0e7f5f
Successfully built scikits.talkbox
Installing collected packages: scikits.talkbox
Successfully installed scikits.talkbox-0.2.5

如果您想要 Python 3 支持,您必须在 scikits.talkbox Github page 上提出问题。 ,但从该存储库的历史记录来看,作者似乎不再活跃于该项目。

出于好奇,我尝试寻找在 Python 3 上安装的解决方法。基本上,该包包含预编译的 Cython 文件,这些文件与 Python 3 不兼容(给出 *.c 的错误) > 文件)。我尝试在Python3.7上用Cython重新编译它:

# download the source code from PyPi
$ wget https://files.pythonhosted.org/packages/65/a0/410eb932e1765186a4728d1c9b28410695d554c47439bcb69a407d5d3921/scikits.talkbox-0.2.5.tar.gz
$ tar -xvzf scikits.talkbox-0.2.5.tar.gz
$ cd scikits.talkbox-0.2.5/

# re-compile with Cython on Python 3.7
$ python3 -V
Python 3.7.4
$ python3 -m pip install numpy scipy cython
$ find . -name '*.pyx' -exec cython {} \;
$ python3 -m pip install .
...
Successfully installed scikits.talkbox-0.2.5

看起来我已经成功安装了它但是当你使用它时:

$ python3
Python 3.7.4 (default, Sep  7 2019, 18:29:04) 
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scikits.talkbox
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cerberus/.virtualenvs/test-py37/lib/python3.7/site-packages/scikits/talkbox/__init__.py", line 6, in <module>
    __all__ += tools.__all__
AttributeError: module 'tools' has no attribute '__all__'
>>> 

..这与包的存储库中报告的 Unresolved 、未被注意到的错误相同:
https://github.com/cournape/talkbox/issues/8

<小时/>

所以......看来你唯一的选择是:

关于python - 无法在 MacOS 上 pip 安装 scikits.talkbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58235392/

相关文章:

python - 我可以在数组中不重复地打印值吗

python - 如何使用 python 比较同一数据框中的两列来创建新列?

macos - 如何在Swift语言中改变NSView的圆角半径

python - 是什么导致 Python 错误 'bad escape\C'?

google-app-engine - 我可以在 Google App Engine Standard(两种类型)中拥有 python27 和 python37 的应用程序版本吗

python - 为什么我不能过滤多索引数据框的第二个索引?

python - 在 3 个较小的图像旁边显示一个大图像

objective-c - 使用 ParseKit 标记化和 DelimitedString

macos - Mac上有类似 "watch"或 "inotifywait"这样的命令吗?

python - 从 Python 中的统一类获取属性