K40 Whisperer on Ubuntu

I had issues getting K40 Whisperer to work on Ubuntu and thought I would share the solution. My laser cutter isn’t here yet so I haven’t tried it with the actual laser. I had problems making it run and with it opening an SVG file.

I tried this on Ubuntu 16 and 18.

After installing and updating Ubuntu, I followed these steps:

  1. Install Inkscape using the Ubuntu Software tool

  2. From the command line, run this command to install the required software for K40 Whisperer:

sudo apt-get install python-pip python-tk

  1. Make a folder named tmp in your home directory.

  2. Download the K40 Whisperer source 0.51 from the ScorchWorks web site. Unzip it in your home directory.

  3. Edit the requirements.txt file and change the line that says pillow to:

pillow==6.2.2

  1. Edit the file svg_reader.py. There are two lines that have tempfile.mkdtemp() in them. Change both to:

tempfile.mkdtemp(dir=os.environ[“HOME”] + “/tmp”)

  1. Run this command to install python libraries from inside the K40_Whisperer_0.51_src folder:

pip install -r requirements.txt

When you try to open an SVG file, it will tell you it can’t find Inkscape. Go to Settings -> General Settings. Put /snap/bin/inkscape in the Inkscape Executable box and click Close.

Go to File -> Save Settings File and save the settings to a file named k40_whisperer.txt in your home folder. This is so the settings get loaded each time you use K40 Whisperer.

Once all that is done, K40 whisperer runs and you can load an SVG file.

The change to requirements.txt is needed because K40 whisperer uses an old version of python and the newest version of pillow doesn’t support python 2 anymore.

The tmp folder change is required because Ubuntu snap software doesn’t have rights to the system tmp folder so when K40 whisperer writes files to /tmp, Inkscape doesn’t have permission to read them. This makes K40 whisperer use a tmp folder in your home folder instead.

This took me quite a while to figure out so I hope it helps others. After I use it with my laser cutter, I’ll test to make sure it works with the laser cutter and then I’ll send these changes to the author of the software (in a way that will also work with Windows).

Jay

4 Likes

I made it all the way through #6 but when I tried to run the command in #7 (pip install -r requirements.txt), I got the following ERROR:

ERROR: Could not open requirements file: [Errno 2] No such file or directory: ‘requirements.txt’

Any suggestions? I’d love to get k40 whisperer working on my linux laptop. Thanks.

Since you edited the requirements.txt file, are you sure you are running the pip command from the directory that requirements.txt is in?

I refreshed my k40-whisperer git repo and tried running( using python2 ) and it would not load an SVG using the latest version of Inkscape( 1.0.? ) so I got 0.9.24 and it worked.

wget https://inkscape.org/gallery/item/13316/Inkscape-9dee831-x86_64.AppImage
chmod +x Inkscape-9dee831-x86_64.AppImage