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
#1
Hi, i want to use python 2.7 but i don't know how to add it in jupyterlab. https://forum.manjaro.org/t/add-python2-...b/162569/1

Can i use python 2.7 in google colab? How?
Reply
#2
No,i do not think you can run Python 2.7 in Colab(default version now on Colab Python 3.10.12)
Why do want to run Python 2.7? end of life💀 was over 4-years ago

If really need to run Python 2.7 can do it in different ways local or eg Docker.
Also can not install stuff from PyPi to Python 2.7.
Have to find older wheels or use setup.py,as most 3-party libraries has removed install option for 2.7 a long time ago.
Reply
#3
I want to run older code that is compatible to python 2.7 . Can you tell me commands that i need to fire in terminal?
Reply
#4
What OS are you using?
Eg i have a Python 2.7 version on Windows and can eg run it like this.
G:\div_code
λ python -V
Python 3.12.2

# Using <py> comes with all Python 3 version
G:\div_code
λ py -2.7 -V
Python 2.7.9
# Run a code with 2.7
λ py -2.7 hello.py
C:\Python27\python.exe
hello world
On linux can eg use pyenv Simple Python Version Management
Or build from source,it all depends how comfortable you are with this stuff.

There also still some online interpreter that has Python 2.7 eg jdoodle , worktech.
Reply
#5
I am using Manjaro Linux.

# System Details Report
---

## Report details
- **Date generated:** 2024-05-28 21:21:49

## Hardware Information:
- **Hardware Model:** Dell Inc. Inspiron 3542
- **Memory:** 2.0 GiB
- **Processor:** Intel® Core™ i3-4005U × 4
- **Graphics:** Intel® HD Graphics 4400 (HSW GT2)
- **Disk Capacity:** 628.1 GB

## Software Information:
- **Firmware Version:** A14
- **OS Name:** Manjaro Linux
- **OS Build:** rolling
- **OS Type:** 64-bit
- **GNOME Version:** 46
- **Windowing System:** X11
- **Kernel Version:** Linux 5.15.158-1-MANJARO
Reply
#6
Install pyenv on Manjaro Linux
pyenv on Arch.org
Same just that you do:
First pyenv install --list and see if 2.7.18 is there if not just use lesser version.
pyenv install 2.7.18
pyenv global 2.7.18

How to set up Docker in Manjaro (Arch Linux)
Eg a image python:2.7.17-alpine
Reply
#7
   ~  sudo pacman -S snapd  ✔
[sudo] password for raman:
warning: snapd-2.62-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) snapd-2.62-2

Total Installed Size: 63.80 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
:: Processing package changes...
(1/1) reinstalling snapd [######################] 100%
:: Running post-transaction hooks...
(1/6) Reloading system manager configuration...
(2/6) Reloading user manager configuration...
(3/6) Creating temporary files...
(4/6) Arming ConditionNeedsUpdate...
(5/6) Reloading system bus configuration...
(6/6) Updating the desktop file MIME type cache...
   ~  sudo systemctl enable --now snapd.socket  ✔  15s 
   ~  sudo ln -s /var/lib/snapd/snap /snap  ✔
ln: failed to create symbolic link '/snap/snap': File exists
   ~ 
Reply
#8
Look like snapd was installed,jsut check that it work.
Service and version:
sudo systemctl status snapd  
snap version
If it work just install pyenv.
Reply
#9
   ~  sudo systemctl status snapd  ✔
[sudo] password for raman:
× snapd.service - Snap Daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.service; disabled; preset: d>
Active: failed (Result: exit-code) since Wed 2024-05-29 07:30:30 IST; 9min>
TriggeredBy: × snapd.socket
Process: 2522 ExecStart=/usr/lib/snapd/snapd (code=exited, status=1/FAILURE)
Main PID: 2522 (code=exited, status=1/FAILURE)
CPU: 98ms

May 29 07:30:30 dell systemd[1]: snapd.service: Scheduled restart job, restart >
May 29 07:30:30 dell systemd[1]: snapd.service: Start request repeated too quic>
May 29 07:30:30 dell systemd[1]: snapd.service: Failed with result 'exit-code'.
May 29 07:30:30 dell systemd[1]: Failed to start Snap Daemon.
May 29 07:30:30 dell systemd[1]: snapd.service: Triggering OnFailure= dependenc>
lines 1-13/13 (END)
Reply
#10
You most search for error you get.
Look at Installing snap on Manjaro Linux

Addition tips.
Ensure that snapd is correctly installed and there are no corrupted files:
sudo pacman -Qk snapd
Sometimes, simply reinstalling snapd can resolve the issue:
sudo pacman -R snapd
sudo pacman -S snapd
Ensure all dependencies for snapd are met. You can do this by updating your system and reinstalling snapd:
sudo pacman -Syu
sudo pacman -S --needed snapd
After reinstalling, try enabling and starting the service again:
sudo systemctl enable --now snapd.socket
sudo systemctl start snapd
Check status:
sudo systemctl status snapd
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 270 Jun-04-2024, 10:55 PM
Last Post: Drone4four
Thumbs Up Python 3 Jupyter notebook ternary plot data nicholas 0 1,078 Jan-21-2023, 05:01 PM
Last Post: nicholas
  Help Python vs Jupyter futureofAI 2 1,693 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 1,978 Apr-27-2021, 08:29 PM
Last Post: Led_Zeppelin
  install jupyter-nb within VSCode apollo 2 2,298 Feb-05-2021, 10:34 AM
Last Post: apollo
  how to install pyramid.arima in jupyter notebook bntayfur 1 4,347 Aug-06-2020, 04:37 AM
Last Post: ndc85430
  Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2 Newtopython123 10 31,727 Apr-25-2019, 07:30 AM
Last Post: banu0395
  Jupyter and python terminal dervast 3 2,854 Mar-29-2019, 02:08 PM
Last Post: dervast
  Code runs as pure python but not jupyter notebook miner_tom 3 3,505 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,057 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