每当我试图导入soundfile
我得到的错误无模块命名音效档
ImportError: No module named soundfile
我貌似安装pysoundfile无故障:
$ sudo pip install pysoundfile
The directory '/Users/theonlygusti/Library/Caches/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 '/Users/theonlygusti/Library/Caches/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 pysoundfile
Downloading PySoundFile-0.9.0.post1-py2.py3.cp26.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp32.pp33-none-macosx_10_5_x86_64.macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (573kB)
100% |████████████████████████████████| 573kB 430kB/s
Requirement already satisfied: cffi>=0.6 in /Library/Python/2.7/site-packages (from pysoundfile)
Requirement already satisfied: pycparser in /Library/Python/2.7/site-packages (from cffi>=0.6->pysoundfile)
Installing collected packages: pysoundfile
Successfully installed pysoundfile-0.9.0.post1
所以什么导致这个问题呢?
您使用的'python'可执行文件是否与您使用的'pip' executabel相匹配? – Evert
Pip默认安装python 2.7的安装包。你用Python 2.7吗? –
@Evert我在'/ usr/local/bin/python'和'/ usr/local/bin/pip'上都运行了'which'。不知道如何检查'sudo'是否相同,但运行'sudo which'返回相同。这可能不是正确的诊断方法。 – theonlygusti