1

I have installed the following.

  • macOS_High Sierra_10.13.4
  • anaconda2-4.4.0
  • python2.7.10

I am running jupyter notebook with the following command.

$ jupyter notebook

However, I am troubled because the "python 2" button is not displayed.

jupyter notebook

I want to run python 2 and I do not want to run python 3. I would like to know how to display the "python 2" button. I confirmed the version of python as below.

$ python --version
python2.7.10

$ ipython --version
5.3.0

$ which python
/usr/bin/python

$ which ipython
/Library/Frameworks/Python.framework/Versions/3.6/bin/ipython

$ pyenv versions
system
anaconda2-4.4.0
* anaconda2-4.4.0/envs/fruits-classify (set by /Users/(username)/pythonspace/.python-version)
jack_three
  • 13
  • 5
  • What are you running on? (os I mean) – Mad Physicist Jun 09 '18 at 02:29
  • I edited the explanation.I am using "macOS_High Sierra_10.13.4". – jack_three Jun 09 '18 at 02:39
  • 1
    What version of Ipython? (`ipython --version`). Did you install Jupyter before or after Python2? – Alan Jun 09 '18 at 02:46
  • Thank you for your comment.I edited the explanation.(ipython --version → 5.3.0) I think that python was installed in the initial state of macOS. – jack_three Jun 09 '18 at 02:57
  • What about `which python`? Anaconda and your OS have different versions of Python. You most likely installed anaconda3, but your OS is using Python 2. jupytrer probably only picks up the anaconda Python. Try to make an environment with `python=2` and see what happens if you run jupyter from there. – Mad Physicist Jun 09 '18 at 02:59
  • @MadPhysicist Thank you.I edited the explanation.Currently I think that anaconda 2 is installed.(pyenv versions → anaconda2-4.4.0)I'd like to create a python 2 environment and run jupyter. Is it difficult for me to create an environment for python 2? Also please tell me if you have a website on how to solve it. – jack_three Jun 09 '18 at 03:29
  • The anaconda documentation is online and quite thorough. There's a detailed tutorial on how to set up an environment. – Mad Physicist Jun 09 '18 at 04:05
  • What happens when you run `which python` in the command line? – Mad Physicist Jun 09 '18 at 04:06
  • @MadPhysicist Thank you.(which python → /usr/bin/python). Maybe.....I think that it corresponds to this question.(https://stackoverflow.com/questions/9386048/ipython-reads-wrong-python-version).However, I am afraid to change this setting. – jack_three Jun 09 '18 at 04:28
  • OK. What about `which ipython`? When you start IPython, what underlying version of Python does it say it's using? – Mad Physicist Jun 09 '18 at 04:32
  • No need. Just make sure anaconda is on your `PATH` *before* `/usr/bin` and everything will be OK. It's clearly not at the moment. Part of the problem may be that you haven't changed your default shell. – Mad Physicist Jun 09 '18 at 04:33
  • @MadPhysicist Thank you.(which ipython → /Library/Frameworks/Python.framework/Versions/3.6/bin/ipython).I confirmed the version of python after starting "jupyter".(python -V → Python 2.7.10) – jack_three Jun 09 '18 at 04:45
  • I changed the setting of PATH. "python2" button was displayed in "jupyter".Thanks. – jack_three Jun 09 '18 at 07:48

0 Answers0