全新 Python 3 安装中没有名为 'info' 的模块

No module named 'info' on fresh Python 3 installation

我通过自制程序在 OSX 上进行了全新的 python3 安装:

brew install python3

然后我为我的项目创建了一个虚拟环境并安装了scipyscikits.samplerate

virtualenv -p /usr/local/bin/python3 pythen_env 
pip install scipy
pip install scikits.samplerate

但是,当我尝试从 scikits.samplerate 导入函数时,出现以下错误:

>>> from scikits.samplerate import resample
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/__init__.py", line 4, in <module>
    from info import __doc__
ModuleNotFoundError: No module named 'info'

Info 恰好是 __init__.py 中导入的包本身的第一个模块。

奇怪的是,模块 info.py 存在于 /my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/:

ls /my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/
__init__.py    setup.py        tests        __pycache__
info.py        setuphelp.py    version.py

当我在没有 virtualenv 的情况下尝试相同的操作以及其他包时,也会发生错误。我该如何开始调试这个问题?

问题似乎出在包 scikits.samplerate does not support Python 3.X (see issue). However, there is a fork which supports Python 3.X 上。您可以通过

安装它
$ pip install git+https://github.com/gregorias/samplerate.git

一如既往:人们可以在存储库中制作任何他们喜欢的东西。我没有检查 gregorias 做了哪些更改。

git 版本支持 py3

https://github.com/cournape/samplerate

(合并来自@gregorias 的 PR)

我也应该找到更新pypi的时间和程序...