Problem installation Meerk40t in Ubuntu 24.04

Hello everyone, I downloaded the latest Ubuntu version of Meerk40t (MeerK40t-Linux-Ubuntu-22.04) and I’m trying to install it in Ubuntu 24.04.1, but when I give the install command I get an error response and I can’t figure out how to fix here’s what happens:

"mino@mino-HP-Compaq-6730s:~/MEERK$ pip install MeerK40t-Linux-Ubuntu-22.04
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.12/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."

how can I solve it? Thank you all

This is Ubuntu telling you that you cannot install meerk40t globally on your system. Several major distributions are defaulting to preventing this now.

The current recommended way for users to install and run python packages (via PIP) is to do this in a virtual environment. As described in the error you pased.

Follow the guidance it gives; create a virtual environment (venv), activate it, install and start meerk40t in that.

This is somewhat new; venvs have been around for a long time but it is only recently that distributions started pushing users to use them.

1 Like

@minuccio

Usually its a flavor of:

cd (folder you want to install the thing / project, like `~/MEERK`)
python3 -m venv venv # creates a virtual python environment, in a folder called `venv`
source venv/bin/activate # Activates the local Python environment
pip install (application - in this case `meerk40t`)
deactivate # Deactivates the local Python virtual environment

Your app will be available to run as (installation directory)/venv/bin/meerk40t. You can create an app launcher shortcut on your desktop which runs it.

PS:
I work a lot with Python, lasers & CNC - would be happy to get on a call with you and help you sort this out together. Feel free to send me a message. Always looking to do code/maker-jams :slight_smile:

// JRO

2 Likes

Thank you for your availability which I really appreciate, I followed your very complete help step by step especially for the comments, but unfortunately I still get an error:
(venv) mino@mino-HP-Compaq-6730s:~/MEERK$ python3 -m venv venv
(venv) mino@mino-HP-Compaq-6730s:~/MEERK$ source venv/bin/activate
(venv) mino@mino-HP-Compaq-6730s:~/MEERK$ pip install MeerK40t-Linux-Ubuntu-22.04
ERROR: Could not find a version that satisfies the requirement MeerK40t-Linux-Ubuntu-22.04 (from versions: none)

"ERROR: No matching distribution found for MeerK40t-Linux-Ubuntu-22.04
(venv) mino@mino-HP-Compaq-6730s:~/MEERK$ "

I use Ubuntu 24.04.1 while the Meerkt40 version is 22.04, could this be the cause?
thanks for everything

Hey @minuccio -

Meerk40t has a ready-to-run release at their website - let’s give that a try, before building it from source.

First, visit the Meerk40t releases page at:

Scroll down to the Assets section.

Copy the link for MeerK40t-Linux-Ubuntu. You can right-click the link, and click “Copy this link”, and paste into a text editor, to save it for later.

For example, the link I got was
https://github.com/meerk40t/meerk40t/releases/download/0.9.7000/MeerK40t-Linux-Ubuntu-22.04 (this link will change as they make new releases, so always check out the latest releases page)

Let’s download the Meerk40t application from this link, into a folder/directory on your computer.

Where you store downloaded applications is up to your personal preference, but I’ll share what I do…

For example, in my user folder (~), I created a _Tools folder, so I might create something like ~/_Tools/CNC/Meerk40t.

If you would like to create that folder structure, you can run mkdir -p ~/_Tools/CNC/Meerk40t (or whatever folder you prefer) to create the directories.

Let’s change to the Meerk40t directory.

cd ~/_Tools/CNC/Meerk40t (example using the file structure above)

Now, now let’s use wget to download the Meerk40t application into this directory.

# Use wget to download the Meerk40t release URL you saved before
# Example command:
wget https://github.com/meerk40t/meerk40t/releases/download/0.9.7000/MeerK40t-Linux-Ubuntu-22.04

Once the download is finished, you can run ls -lah to verify the file is downloaded.

You may also notice the file permissions look like -rw-r--r--. This means that we can READ (r) the file, but we cannot RUN (x) it yet.

You can use chmod u+x (filename) to make a file executable / run’able.

For this file, we can run:

# Add Execute permissions on this file for the user / owner of this file.
chmod u+x MeerK40t-Linux-Ubuntu-22.04

If you run ls -lah again, you ought to see -rwxr--r--. That x means that the file is executable, and we can run it.

Now that we have the application, and it’s executable, let’s try it out.

# Run Meerk40t from the current directory
./MeerK40t-Linux-Ubuntu-22.04

# Run Meerk40t from other directories, or as a shortcut
/home/(user name)/_Tools/CNC/MeerK40t-Linux-Ubuntu-22.04

My computer’s operating system is Debian “Bookworm” Linux (similar to yours), and after a few moments, the Meerk40t application’s interface opened, ready to go!

See if that works for you - if not, we can figure it out.

Notes on your Python question
I attempted to install using Python - by the way, the command you can try is pip install meerk40t[all] - however, I got blocked when the installer wanted wxpython.

Then I took a step back and thought - wait, do we NEED to install this from source? That’s when I downloaded the release, and it just worked…

If you need to install from source, this is the documentation to follow. Install: Source · meerk40t/meerk40t Wiki · GitHub

I am hoping that the downloadable release works for you. Let us know how it goes, and if you get stuck. We’ll sort it out together, no worries.

Good luck!

// JRO

1 Like

Hi, thanks again for your kind availability, sometimes the most banal things are the ones that make you lose your mind, I wasn’t compiling the program but I had downloaded the Meerk40t-Linux-Ubuntu-22.04 file from the site… and I hadn’t thought of adding the execution permission (+x)!!! I’m very stupid, in fact once I added the permission it now runs without problems.
Thank you very much and if you want we can also talk to exchange opinions, advice and more since you too are passionate about CNC… I have a Sculpfun S9, a Cnc Pro 3018 and a Longer LK4 pro 3D printer… Thank you for everything.

My email is minuccio63@gmail.com

Thank you from Italy

1 Like

Glad it you got it working

I’ll send you an email - would love to hear about what you’re working on, upcoming project ideas.

Ciao! // JRO