在iPython交互式shell中使用conda环境

unk*_*_jy 11 environment ipython anaconda conda

我想在我的conda env中使用iPython的交互式shell并且遇到问题.我采取的步骤是:

source activate myenv
conda install ipython
ipython
Run Code Online (Sandbox Code Playgroud)

当我在ipython交互式shell中时,它从anaconda根bin调用python.(~/anaconda2/bin')

我有什么办法可以改变python路径~/anaconda2/envs/myenv/bin并从myenv导入包吗?

当我在网上搜索时,我看到很少有解决方案让env在jupyter中工作,但没有回答让它在交互式shell上工作.

Mat*_*att 2

这可能是由于您的$PATH变量被搞乱了。

确保从环境中获取 IPython 的最简单方法是使用$ python -m IPython <rest of the options>启动 IPython。这适用于许多 Python 可安装应用程序;像 pytest、pip 等。