Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of jupyter notebooks fails when running Config & Demo option #156

Open
cybersecfaith opened this issue Aug 11, 2024 · 3 comments

Comments

@cybersecfaith
Copy link
Contributor

After selecting S - RasQberry Setup - CD - Configs & Demo, the following packages fail to install with error shown below:

  • jupyter notebooks
  • Jupyter Notebook Widgets


configure jupyter notebooks
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
/home/pi/.local/bin/rq_jupyter_conf.sh: line 6: /home/pi/.local/bin/jupyter: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'notebook'

sed: can't read /home/pi/.jupyter/jupyter_notebook_config.py: No such file or directory
sed: can't read /home/pi/.jupyter/jupyter_notebook_config.py: No such file or directory
Jupyter Notebook Widgets
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
/home/pi/.local/bin/rq_jupyter_conf.sh: line 14: jupyter: command not found
/home/pi/.local/bin/rq_jupyter_conf.sh: line 15: jupyter: command not found
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

Cloning into 'Fun-with-Quantum'...
remote: Enumerating objects: 390, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 390 (delta 40), reused 17 (delta 17), pack-reused 327
Receiving objects: 100% (390/390), 11.36 MiB | 2.67 MiB/s, done.
Resolving deltas: 100% (214/214), done.
Cloned Fun-with-Quantum Repository
Cloning into 'qiskit-tutorials'...
remote: Enumerating objects: 11562, done.
remote: Counting objects: 100% (11562/11562), done.
remote: Compressing objects: 100% (4600/4600), done.
remote: Total 11562 (delta 6889), reused 11492 (delta 6873), pack-reused 0
Receiving objects: 100% (11562/11562), 150.82 MiB | 2.71 MiB/s, done.
Resolving deltas: 100% (6889/6889), done.
Cloned Qiskit-tutorials Repository
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libsdl2-2.0-0 is already the newest version (2.26.5+dfsg-1).
libsdl2-2.0-0 set to manually installed.
libsdl2-image-2.0-0 is already the newest version (2.6.3+dfsg-1).
libsdl2-image-2.0-0 set to manually installed.
libsdl2-mixer-2.0-0 is already the newest version (2.6.2+dfsg-2).
libsdl2-mixer-2.0-0 set to manually installed.
libsdl2-ttf-2.0-0 is already the newest version (2.20.1+dfsg-2).
libsdl2-ttf-2.0-0 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Installed Kivy

Verifying whether or not the installation went through:

pi@raspberrypi:~ $ jupyter notebook --version
-bash: jupyter: command not found
pi@raspberrypi:~ $ pip3 list installed | grep jupyter
pi@raspberrypi:~ $ 

We do however see this at the end of the installation process nonetheless.

Pasted Graphic 18

Suggested workaround - perhaps install using the pipx command if python3 -m venv path/to/venv. is not an option. That was what I used to install gist which also had failed in the initial installation.

pi@raspberrypi:~ $ pip3 install getgist
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

$ sudo apt install pipx

3/

pi@raspberrypi:~ $ pipx install getgist
  installed package getgist 0.2.2, installed using Python 3.11.2
  These apps are now globally available
    - getgist
    - getmy
    - lsgists
    - putgist
    - putmy
⚠️  Note: '/home/pi/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to
    automatically add it, or manually modify your PATH in your shell's config file (i.e. ~/.bashrc).
done! ✨ 🌟 ✨
pi@raspberrypi:~ $ pipx ensurepath
Success! Added /home/pi/.local/bin to the PATH environment variable.

Consider adding shell completions for pipx. Run 'pipx completions' for instructions.

You will need to open a new terminal or re-login for the PATH changes to take effect.

Otherwise pipx is ready to go! ✨ 🌟 ✨
@JanLahmann
Copy link
Owner

JanLahmann commented Aug 13, 2024

Hi @cybersecfaith thanks a lot for the detailed issue report and the suggested workaround !
On what exact version of Raspberry Pi OS did you try this?
Which option did you choose when initiatlizing the SD card with Raspberry Pi Imager?
This version of RasQberry is only tested with the "legacy" 32-bit version of Raspberry Pi OS, based on Debian Bookworm (Bullseye will most probably not work).

@cybersecfaith
Copy link
Contributor Author

Hi @JanLahmann - that might explain it. I used the default recommended OS version for my pi on imager which was the 64bit. I'll reimage and use the 32bit. Shouldn't be a problem.

IMG_6364

@cybersecfaith
Copy link
Contributor Author

cybersecfaith commented Aug 13, 2024

Specific version that I am running is bookworm.

pi@raspberrypi:~/RasQberry/config $ uname -a
Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

pi@raspberrypi:~/RasQberry/config $ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm

pi@raspberrypi:~/RasQberry/config $ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants