【问题标题】:How can I install python-gasp on Ubuntu 16.04?如何在 Ubuntu 16.04 上安装 python-gasp?
【发布时间】:2016-11-17 03:40:12
【问题描述】:

我使用的是 Ubuntu 16.04 系统,我想为 python 安装gasp。 有人告诉我,以下命令可以帮助我安装python-gasp

 $ sudo apt-get install python-gasp

我尝试了命令,但它似乎不起作用,因为当我运行时

from gasp import 

它返回为

"No module named gasp".

然后我使用$ whereis python-gasp检查我安装的python-gasp的位置,它返回为/usr/share/python-gasp

我不知道发生了什么。 如何成功使用gasp

【问题讨论】:

  • 您在使用 apt-get 时是否收到错误消息?你使用 Python2 吗? Ubuntu16 默认使用 Python3。 python-gasp 用于 Python2,python3-gasp 可以用于 Python3。如果whereis 可以找到它,那么它可能是您可以运行的程序$ python-gasp
  • 非常感谢。安装完 Ubuntu16 后,我已将默认设置更改为 python2.7。我使用'$python --version' 来确认这一点,上面写着'Python 2.7.12 :: Anaconda 4.2.0 (64-bit)'。所以,我可以确保默认模式是 Python2。
  • 不要更改 Ubuntu 中的默认 Python,因为它在很多事情上都使用 Python - 它会破坏系统。您可以同时安装两个版本并使用python2python2.7pip2pip2.7(和python3pip3
  • 我在互联网上查看gasp。快5年了,没有Python3的版本。
  • 非常感谢您的建议,我是 Linux 和 Python 的新手。但我深深地爱着他们。我会努力学习bash、linux和python。

标签: python linux ubuntu gasp


【解决方案1】:

python-gasp 是 Python 2 的模块。我没有看到 Python 3 的 python3-gasp(基于 Ubuntu 14.04 的 Linux Mint 17),但也许你在 Ubuntu 16 上拥有。

Ubuntu 16 默认使用 Python 3。也许您必须安装 Python 2 才能使用 gasp

或者你可能已经安装了。尝试python2which python2 查找路径。

【讨论】:

  • 非常感谢。安装完 Ubuntu16 后,我已将默认值更改为 python2.7。我使用'$python --version' 来确认这一点,上面写着'Python 2.7.12 :: Anaconda 4.2.0 (64-bit)'。所以,我可以确保默认模式是 Python2。而且我在安装GASP的时候发现一个错误,它说:“Sub-process /usr/bin/dpkg returned an error code (1)”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-24
  • 2016-10-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多