[英]Error installing python-midi package on Windows
我試圖使用pip在Windows上為python安裝一些軟件包,並在嘗試安裝python-midi時收到以下錯誤:
(env) C:\Users\Asus\Documents\LEI\Algo-Rhythm>pip install python-midi
Collecting python-midi
Using cached python-midi-v0.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-build-zqxbr1j2\python-midi\setup.py", line 42
print "No sequencer available for '%s' platform." % platform
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "No sequencer available for '%s' platform." % platform)?
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Asus\AppData\Local\Temp\pip-build-zqxbr1j2\python-midi\
我查找了發生錯誤的文件,但是即使查看隱藏文件也找不到它。 如果有人知道是什么原因引起的,或者也遇到了此問題,我將很高興聽到。 提前致謝。
發生此錯誤的原因是因為此軟件包是針對Python 2的。您可以通過print語句的舊樣式來判斷。
Python 2
print "hey"
Python 3
print("hey")
我建議您檢查一下從原始python-midi
軟件包中派生的python3-midi 。
我剛剛更新了setup.py文件中的打印語句。
def configure_platform():
from sys import platform
ns = __base__.copy()
# currently, only the ALSA sequencer is supported
if platform.startswith('linux'):
setup_alsa(ns)
pass
else:
print("No sequencer available for '%s' platform." % platform)
return ns
希望對您有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.