简体   繁体   English

如何在 Ubuntu 18.04 上成功安装 sciencepython package?

[英]How do I install scientificpython package successfully on Ubuntu 18.04?

I have installed Python 3.7.6 on my Ubuntu 18.04 system.我已经在我的 Ubuntu 18.04 系统上安装了 Python 3.7.6。 I am trying to install package called "scientificpython" but consistently getting the following error message.我正在尝试安装名为“scientificpython”的 package,但始终收到以下错误消息。

(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.

How do I resolve this problem?我该如何解决这个问题?

Based on your traceback and the ScientificPython home page :根据您的回溯和ScientificPython 主页

Therefore ScientificPython can be used only with Python 2.7 and NumPy 1.8, but not with later releases of either software.因此,ScientificPython 只能与 Python 2.7 和 NumPy 1.8 一起使用,但不能与这两个软件的更高版本一起使用。

You are using Python 3.7.6, which does not recognize print as a statement as it existed in Python 2, for starters.对于初学者,您正在使用 Python 3.7.6,它不能将print识别为存在于 Python 2 中的语句。

You can install Python 2 from source , or use a tool such as pyenv to manage multiple Python versions alongside each other.您可以从源安装 Python 2 ,或者使用诸如pyenv 之类的工具来管理多个 Python 版本。

Try to install ScientificPython by specifying the version尝试通过指定版本来安装 ScientificPython

Command:命令:

pip install ScientificPython==2.9.4

Or Try:或尝试:

python -m pip install ScientificPython==2.9.4

If problem still persist, then try to download the tar file of the package then install it manually.如果问题仍然存在,请尝试下载 package 的 tar 文件,然后手动安装。 Available links are provided.提供了可用的链接。

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

Or或者

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

Or或者

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

But ScientificPython works only with Python version 2. So it is recommended to use the alternative package called Scipy.但 ScientificPython 仅适用于 Python 版本 2。因此建议使用名为 Scipy 的替代 package。

Command:命令:

pip install scipy

Or或者

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

I hope it would resolve the error.我希望它能解决错误。

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

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