【发布时间】:2017-03-18 02:33:34
【问题描述】:
我同时安装了 Python 2.7 和 3.5。如果我使用 python 从命令行运行脚本,它使用 Python 2.7,但如果我启动 iPython,它使用 Python 3:
kurt@kurt-ThinkPad:~$ python -V
Python 2.7.12
kurt@kurt-ThinkPad:~$ ipython
Python 3.5.2 (default, Sep 10 2016, 08:21:44)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]:
有没有办法启动 iPython 以便它使用 Python 2? (我使用的是 Ubuntu LTS 16.04)。
【问题讨论】:
-
你是如何安装 ipython 的?
-
我仍在寻找解决方案,因为虚拟环境无法访问未使用
pip安装的其他模块,例如rethinkdb。 Nurzhan,我不记得我是如何安装 iPython 的,但我相信我下载了 .whl 文件并做了pip install [ipython_file].whl。 -
我使用
sudo apt-get install ipython在 xubuntu 16.04 LTS 上安装了 ipython。它默认使用 python 2.7.12。我不知道你为什么有这个问题。我知道从 Ubuntu 16.04 LTS 开始的 vim 默认使用 python3。
标签: python-2.7 ipython