在python2.7.10anaconda 2.3.0(64位)中,如果我写
sys.path.append('C:\\Anaconda\\sms-tools-master\\software\\models\\utilFunctions_C\\')
print sys.path
我明白了
C:\Anaconda\sms tools master\workspace\A1>;python A1Part1.py ['C:\Anaconda\sms tools master\workspace\A1','C:\Anaconda\python27.zip', 'C:\Anaconda\dll','C:\Anaconda\lib','C:\Anaconda\lib\plat win','C:\A naconda\lib\lib tk','C:\Anaconda','C:\Anaconda\lib\site packages','C:\ Anaconda\lib\site packages\Sphinx-1.3.1-py2.7.egg','C:\Anaconda\lib\site- packages\cryptography-0.9.1-py2.7-win-amd64.egg','C:\Anaconda\lib\site pack ages\win32','C:\Anaconda\lib\site packages\win32\lib','C:\Anaconda\lib \站点包\Pythonwin','C:\Anaconda\lib\site packages\setuptools-17.1。 1-py2.7.egg','C:\Anaconda\sms tools master\software\models\utilFunctions\u C \']
在我写的下一行python代码中
从utilFunctions\u C导入wavread
我立刻得到
ImportError: cannot import name wavread
如果我在cmd中运行代码,但是如果我在IDLE中运行代码,我会得到:
['C:\Anaconda\sms-tools-master\workspace\A1', 'C:\Python27\Lib\idlelib', 'C:\Windows\system32\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-packages', 'C:\Anaconda\sms-tools-master\software\models\utilFunctions_C\']
Traceback (most recent call last): File "C:\Anaconda\sms-tools-master\workspace\A1\A1Part1.py", line 8, in from utilFunctions_C import wavread ImportError: DLL load failed: %1 is not a valid Win32 application.
那么,为什么会有区别,以及如何解决这个问题呢?谢谢!在
我评论道
并使用
^{pr2}$现在我的代码没问题了。我发现了
卷进 https://class.coursera.org/audio-002/forum/search?q=Cannot+import+name+wavread#15-state-query=wavread&15-state-page_num=1
更多细节。在
相关问题 更多 >
编程相关推荐