我已经在我的Ubuntu 18.04系统上安装了Python 3.7.6。我试图安装名为“scientificpython”的软件包,但始终收到以下错误消息
(base) jit@jit-VirtualBox:~$ pip install scientificpython
Collecting scientificpython
Using cached ScientificPython-2.9.4.tar.gz (688 kB)
ERROR: Command errored out with exit status 1:
command: /home/jit/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o8a8hyd1/scientificpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o8a8hyd1/scientificpython/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-o8a8hyd1/scientificpython/pip-egg-info
cwd: /tmp/pip-install-o8a8hyd1/scientificpython/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-o8a8hyd1/scientificpython/setup.py", line 72
print "netCDF not found, the netCDF module will not be built!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("netCDF not found, the netCDF module will not be built!")?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
如何解决这个问题
根据您的回溯和ScientificPython home page:
您使用的是Python3.7.6,它不会将
print
识别为一条语句,因为它存在于Python2中您可以install Python 2 from source,或者使用pyenv之类的工具来管理多个Python版本
尝试通过指定版本来安装ScientificPython
如果问题仍然存在,则尝试下载包的tar文件,然后手动安装。提供了可用的链接
或
或
但是ScientificPython只适用于Python版本2。因此,建议使用名为Scipy的替代软件包
或
我希望它能解决这个错误
相关问题 更多 >
编程相关推荐