Python Forum
Install python 2.7 in jupyter lab
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install python 2.7 in jupyter lab
#21
I have already saved in .bashrc file:

1
2
3
4
# pyenv setup, can place last in file
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
but i am still unable to use python2.7 ? Huh
1
2
3
4
5
6
7
8
9
10
11
12
    ~  pyenv local 2.7.18                                               ✔
    ~  python                                                           ✔
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>>
    ~  pyenv global 2.7.18                                       ✔  6s
    ~  python                                                           ✔
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Reply
#22
I have already saved in .bashrc file:

1
2
3
4
# pyenv setup, can place last in file
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
I am still unable to use python2.7 Huh
1
2
3
4
5
6
7
8
9
10
11
12
    ~  pyenv local 2.7.18                                               ✔
    ~  python                                                           ✔
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>>
    ~  pyenv global 2.7.18                                       ✔  6s
    ~  python                                                           ✔
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Reply
#23
Hmm ok,look lilke Manjaro(i dont't use it) use zsh as default shell.
Quote:Manjaro seems to install both bash (login shell) and zsh (user preferred shell, e.g. when opening a console).
Then you need to add lines to zsh shell.
So vi ~/.zshrc or nano ~/.zshrc and add same line to this file and save.
1
2
3
4
# pyenv setup, can place last in file
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
Restart shell and try again.
Reply
#24
1
2
3
    ~  echo "$SHELL"                                                    ✔
/bin/zsh
    ~        
Reply
#25
1
2
3
4
5
6
    ~  pyenv local 2.7.18                                               ✔
    ~  python                                                           ✔
Python 2.7.18 (default, May 30 2024, 21:44:42)
[GCC 13.2.1 20240417] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Good Dance
Reply
#26
Can now i use python2.7.18 in Jupyter notebook?

Thank You for helping me. so main mistake was the shell used by Manjaro Linux.
Reply
#27
Good pyenv finally works 👍
Can now eg install a Anaconda that use Python 2,this comes with Jupyter Notebook pre-installed.
Example look at pyenv install --list.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tom@tom-VirtualBox:~$ pyenv install anaconda2-2019.10
Downloading Anaconda2-2019.10-Linux-x86_64.sh...
-> https://repo.anaconda.com/archive/Anaconda2-2019.10-Linux-x86_64.sh
Installing Anaconda2-2019.10-Linux-x86_64...
Installed Anaconda2-2019.10-Linux-x86_64 to /home/tom/.pyenv/versions/anaconda2-2019.10
 
# Switch to this version global or local
tom@tom-VirtualBox:~$ pyenv global anaconda2-2019.10
 
# Test
tom@tom-VirtualBox:~$ python -V
Python 2.7.16 :: Anaconda, Inc.
 
# Start jupyter notebook will now use Python 2
tom@tom-VirtualBox:~$ jupyter notebook
Larz60+ likes this post
Reply
#28
I have Jupyter notebook already installed. My laptop has 2 GB RAM. Can i use python2.7 in Jupyter notebook without installing Anaconda?
Reply
#29
(Jun-01-2024, 12:25 PM)raman Wrote: I have Jupyter notebook already installed. My laptop has 2 GB RAM. Can i use python2.7 in Jupyter notebook without installing Anaconda?
No that will not work,need a new Jupyter kernel that use Python 2.
The Anaconda version you install is stand alone,and will not affect other stuff that installed.
Can just remove when don't need it anymore.
1
pyenv uninstall anaconda2-2019.10
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 2,519 Jun-04-2024, 10:55 PM
Last Post: Drone4four
Thumbs Up Python 3 Jupyter notebook ternary plot data nicholas 0 1,891 Jan-21-2023, 05:01 PM
Last Post: nicholas
  Help Python vs Jupyter futureofAI 2 2,308 Oct-17-2021, 09:45 AM
Last Post: futureofAI
  It says there is no keras in jupyter notebook. it is wrong there is a keras install Led_Zeppelin 0 2,562 Apr-27-2021, 08:29 PM
Last Post: Led_Zeppelin
  install jupyter-nb within VSCode apollo 2 3,751 Feb-05-2021, 10:34 AM
Last Post: apollo
  how to install pyramid.arima in jupyter notebook bntayfur 1 5,141 Aug-06-2020, 04:37 AM
Last Post: ndc85430
  Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2 Newtopython123 10 35,316 Apr-25-2019, 07:30 AM
Last Post: banu0395
  Jupyter and python terminal dervast 3 3,772 Mar-29-2019, 02:08 PM
Last Post: dervast
  Code runs as pure python but not jupyter notebook miner_tom 3 4,613 Aug-22-2018, 04:00 PM
Last Post: miner_tom
  1 What is Jupyter? and what's the difference between it and "pure python"? InigoSJ 2 3,796 Apr-05-2018, 07:24 PM
Last Post: InigoSJ

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020