maholli / PY4_gs

https://maholli.github.io/PY4_gs/
MIT License
1 stars 0 forks source link

pip3 install errors #2

Open K4KDR opened 7 months ago

K4KDR commented 7 months ago

Hardware: Rasp-Pi 4B O/S: 64-bit 'Lite' RPi OS

k4kdr@PY4-rpi:~ $ python --version Python 3.11.2

k4kdr@PY4-rpi:~ $ pip3 --version pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)

============

Following your line-by-line instructions to setup a Rasp-Pi for this project, the following error displays when I get to the last two steps, which are:

pip3 install --upgrade RPi.GPIO
pip3 install --upgrade adafruit-blinka

... both commands return the following. Any help appreciated!!

k4kdr@PY4-rpi:~ $ pip3 install --upgrade adafruit-blinka
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.
maholli commented 7 months ago

There's an easy way and a correct way to handle this. In most cases I go the easy way:

run this command: sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED

You may need to change the 3.11 to 3.12 (depending on the python version installed)

Then you can proceed with the previous commands without error.

K4KDR commented 7 months ago

Worked perfectly - thanks so much!

Also, since the easiest way to download (and later update) the files from this repository is with the 'git' command, you may wish to add the following to that list of install steps.

sudo apt-get install git

... lastly, I did NOT run the command in the how-to that I believe would disable SSH since the way I am connecting to the R-Pi is via SSH. If I'm interpreting that command correctly (sudo raspi-config nonint do_ssh 0), you may wish to mark it as "Optional"

Thanks again!