简体   繁体   English

如何配置我的bash_profile以执行ipython3

[英]How to configure my bash_profile to execute ipython3

I'm using Anaconda 2 and Anaconda 3 in my Mac X OS. 我在Mac X OS中使用Anaconda 2和Anaconda 3。 I need open the notebook from python3 (Anaconda 3). 我需要从python3(Anaconda 3)打开笔记本。 I use this command: "ipython notebook" on the terminal to open notebook from Python 2. 我在终端上使用以下命令:“ ipython notebook”从Python 2打开笔记本。

Can someone help me to configure bash_profile or a different way to open the notebook from Py3? 有人可以帮助我配置bash_profile或通过其他方式从Py3打开笔记本吗?

Thanks 谢谢

There are several ways you could do that. 有几种方法可以做到这一点。

You can put the Anaconda3 first in the path: 您可以将Anaconda3放在路径的首位:

PATH=/path/to/anaconda3:$PATH

Or make an alias: 或做一个别名:

alias ipython='ipython3'
alias ipython2='ipython'

Assuming ipython3 is in the path somehow 假设ipython3处于某种路径

I have this in my bash_profile: 我的bash_profile中有这个:

# Python
alias py2="/Users/andres.vara/Python/Anaconda2/anaconda/bin/python"
alias pip2="/Users/andres.vara/Python/Anaconda2/anaconda/bin/pip"
alias py3="/Users/andres.vara/Python/Anaconda3/anaconda/bin/python"
alias pip3="/Users/andres.vara/Python/Anaconda3/anaconda/bin/pip"


# export PATH="/Users/andres.vara/Python/Anaconda3/anaconda/bin:$PATH"
export PATH="/Users/andres.vara/Python/Anaconda2/anaconda/bin:$PATH"

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

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