如何在Ubuntu 18.04上成功安装scientificpython包?

2024-06-11 23:17:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经在我的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.

如何解决这个问题


Tags: installpippyinfoeggsetupnotnetcdf
2条回答

根据您的回溯和ScientificPython home page

Therefore ScientificPython can be used only with Python 2.7 and NumPy 1.8, but not with later releases of either software.

您使用的是Python3.7.6,它不会将print识别为一条语句,因为它存在于Python2中

您可以install Python 2 from source,或者使用pyenv之类的工具来管理多个Python版本

尝试通过指定版本来安装ScientificPython

Command:

pip install ScientificPython==2.9.4

Or Try:

python -m pip install ScientificPython==2.9.4

如果问题仍然存在,则尝试下载包的tar文件,然后手动安装。提供了可用的链接

https://files.pythonhosted.org/packages/a2/8e/6306c88c0e937af38ed3a40e2a08caf30c53ad7f33e2928f14ae2cf53961/ScientificPython-2.9.4.tar.gz

https://src.fedoraproject.org/lookaside/extras/ScientificPython/ScientificPython-2.8.1.tar.gz/

https://osdn.net/frs/g_redir.php?m=kent&f=anuga%2Fanuga_support_software%2Fubuntu_8.10%2FScientificPython-2.9.0.tar.gz

但是ScientificPython只适用于Python版本2。因此,建议使用名为Scipy的替代软件包

Command:

pip install scipy

python -m pip install  user numpy scipy matplotlib ipython jupyter pandas sympy nose

我希望它能解决这个错误

相关问题 更多 >