简体   繁体   English

双击win7无法导入声音文件吗?

[英]Can not import soundfile when double click on win7?

I make a code test.py like this: 我这样编写代码test.py:

import soundfile
print("import success")

when I try to run this on windows 7, I can only run successfully by cmd: 当我尝试在Windows 7上运行此命令时,只能由cmd成功运行:

python test.py

but I cannot run it by double click on test.py, it's too fast to dispear, I can see it display: 但是我无法通过双击test.py来运行它,它消失得太快了,我可以看到它显示:

no module named soundfile

And I notice that, when I double click test.py on windows 10, it successed. 而且我注意到,当我在Windows 10上双击test.py时,它成功了。

THX to @BoarGules, by using 通过使用THX到@BoarGules

where python

in cmd. 以cmd为单位。 I replace python path from python2.7 to python3 in regedit HKEY_CLASSES_ROOT\\Python.File\\shell\\open\\command . 我在regedit HKEY_CLASSES_ROOT \\ Python.File \\ shell \\ open \\ command中替换了从python2.7到python3的python路径。 Then double-click working! 然后双击工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM