Python bug

When trying to install it in my Pika OS:
brito@AuroraBorealisWorkstation:~$ curl https://get.modular.com | MODULAR_AUTH=[redacted] sh - | distro=pika version=23.04 codename=lunar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3176 100 3176 0 0 9158 0 --:--:-- --:--:-- --:--:-- 9152
brito@AuroraBorealisWorkstation:~$ modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/brito/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
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.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

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.
modular: error: failed to run python:
brito@AuroraBorealisWorkstation:~$
brito@AuroraBorealisWorkstation:~$ curl https://get.modular.com | MODULAR_AUTH=[redacted] sh - | distro=pika version=23.04 codename=lunar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3176 100 3176 0 0 9158 0 --:--:-- --:--:-- --:--:-- 9152
brito@AuroraBorealisWorkstation:~$ modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/brito/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
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.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

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.
modular: error: failed to run python:
brito@AuroraBorealisWorkstation:~$
22 Replies
Stole
Stole12mo ago
@🪶 𝕴𝖔𝖘𝖊𝖕𝖍 Best not to post your Modular auth token. That's the one that starts with mut_. I'd redact it out if I were you.
Old Man Mariner
Old Man Mariner12mo ago
Did I do it?
ModularBot
ModularBot12mo ago
Congrats @🪶 𝕴𝖔𝖘𝖊𝖕𝖍, you just advanced to level 1!
Stole
Stole12mo ago
Yep
Old Man Mariner
Old Man Mariner12mo ago
Thanks
Stole
Stole12mo ago
It looks like Pika OS doesn't use apt even though it does have an Ubuntu base. Modular officially only supports a couple Ubuntu versions at the moment Maybe you could try modifying the installer script to use pikman if it's similar enough to apt? Though that's likely a botched solution, just a thought I'm not acquainted with Pika OS
❤🔥
❤🔥12mo ago
As far as I understand, mojo uses the system python. In the latest version of python on Linux, you cannot install packages using pip without using env, but this is very easily fixed. Just delete 1 file
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
And try to run the mojo installation again.
Old Man Mariner
Old Man Mariner12mo ago
Thanks for the fix! New one though:
❤🔥
❤🔥12mo ago
Try entering
modular clean
modular clean
And install mojo again
modular install mojo
modular install mojo
Old Man Mariner
Old Man Mariner12mo ago
Same bug
❤🔥
❤🔥12mo ago
try execute
modular install mojo
modular install mojo
from root user
Old Man Mariner
Old Man Mariner12mo ago
Everything went well 😄 Now I have a question Will I only be able to use that installation in root, then? Or is it system-wide?
❤🔥
❤🔥12mo ago
Did you write the commands that the installer issued after installation?
Old Man Mariner
Old Man Mariner12mo ago
Not yet, but it seems they tell me to use root paths 🔥 Mojo installed! 🔥 Now run the following commands if you are using bash: echo 'export MODULAR_HOME="/root/.modular"' >> ~/.bashrc echo 'export PATH="/root/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc source ~/.bashrc If you are using ZSH, run the following commands: echo 'export MODULAR_HOME="/root/.modular"' >> ~/.zshrc echo 'export PATH="/root/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc source ~/.zshrc Then enter 'mojo' to start the Mojo REPL. For tool help, enter 'mojo --help'. For more docs, see https://docs.modular.com/mojo.
❤🔥
❤🔥12mo ago
One idea, try copying .modular to your user's folder and replacing /root/ with /home/YOUR USER/
sudo cp -r /root/.modular /home/YOUR USER
echo 'export MODULAR_HOME="/home/YOUR USER/.modular"' >> ~/.bashrc
echo 'export PATH="/home/YOUR USER/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
sudo cp -r /root/.modular /home/YOUR USER
echo 'export MODULAR_HOME="/home/YOUR USER/.modular"' >> ~/.bashrc
echo 'export PATH="/home/YOUR USER/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Want results from more Discord servers?
Add your server