![我该如何解决这个“SyntaxError:无效语法”?](https://linux22.com/image/1178722/%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E8%BF%99%E4%B8%AA%E2%80%9CSyntaxError%EF%BC%9A%E6%97%A0%E6%95%88%E8%AF%AD%E6%B3%95%E2%80%9D%EF%BC%9F.png)
$ pip3 install PyFFTW3
Collecting PyFFTW3
Using cached PyFFTW3-0.2.1.tar.gz (25 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o6a_mdhw/PyFFTW3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o6a_mdhw/PyFFTW3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-o6a_mdhw/PyFFTW3/pip-egg-info
cwd: /tmp/pip-install-o6a_mdhw/PyFFTW3/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-o6a_mdhw/PyFFTW3/setup.py", line 81
print "build %s from template %s" %(outfile, tmplfile)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
答案1
FFTW 的 Pythonic 包装器 - Python 3(python3-pyfftw) 可以从所有当前支持的 Ubuntu 版本中的默认 Ubuntu 存储库安装。要安装它,请打开终端并输入:
sudo apt install python3-pyfftw