Whisperer no longer Initiates laser on Google Slate

Hey all. Having the same issue. Google Slate running Whisperer and ran it a few days ago and now same issue. I installed pyusb and now it doesn’t have the "Unable to load USB library (Sending data to Laser will not work.)” However, it still does not work. It now says
Traceback (most recent call last):
File “./k40_whisperer.py”, line 28, in
from svg_reader import SVG_READER
File “/home/karpmanfished/K40_Whisperer-0.55_src/svg_reader.py”, line 35, in
from PIL import Image
ImportError: No module named PIL
Any help would be appreciated! Also as a fair warning…total Linux noob.

Also to specify the problem is my laser will not initiate. Not actually an issue with the coding to me…I need the laser. Ha

See above, ha. Sorry didn’t know how ta ping ya. @mcdanlj I was trying to tag Scorch but now I figured it out

Looks like you don’t have PIL installed. There may be other libraries that may not be installed so if you get similar messaged for other libraries you can google how to install the module. Sometimes the module name is not exactly the same as the error message when installing it.

For example you need to install PIL which can be installed with the command “pip install Pillow”

1 Like

Yeah I tried that after it failed a few times. So I started from scratch and did all this (see code below)…again. It does seem like some things on my Google Slate got updated. New Icons and a little Dashboard icon for Whisperer. Could that have caused it not to work?
______CODE_____I____USED_____BELOW:
Setting up K40whisperer on Linux (by Dr. med. JanSchiefer):

Requirements

Prerequirements:

  • python
  • unzip
  • udev
  • inkscape

Instructions

  1. Create a group for the users who are allowed to use the laser cutter: sudo groupadd lasercutter

  2. Add your yourself to this group, replace [YOUR USERNAME] with your unix username: sudo usermod -a -G lasercutter carpmanfishhead

  3. Eventually add other users who will use the laser cutter to the group

  4. Plug in your laser cutter to your computer

  5. Create a udev control file four your laser cutter as root (i used nano because that’s the program I have) will use gedit in this example): sudo nano /etc/udev/rules.d/97-ctc-lasercutter.rules

Had to edit the code because I am new here. :slight_smile:

Also tried…
pip install PIL
Collecting PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

I don’t know. Bottom line is the Pillow library needs to be installed. I don’t have any special knowledge related to installing python libraries. If I were having your issue I would exercise Google. Also uninstall any PIL/Pillow that is currently installed and start over. K40 Whisperer works with Python 2.7 and 3.x so you could also try a different python version. Sometimes more than 1 python version is installed on a single Linux distro.

Yeah in theory it is. IDK. I installed it originally and had to run a few different changes in the code from the instructions (IE nano instead of gedo? gebo?). However, I did get it to work and have been trucking along…two days ago this error. So it was working and is now not. Does that help at all with my dilemma? Can say Inkscape update on its on like a PC/Mac?
Also I tried googling the “File “./k40_whisperer.py”, line 28, in
from svg_reader import SVG_READER”
with no real luck.
Code I ran/Programs installed.
“10. Install the requires python packages using the following commands:
pip install lxml
pip install pyusb
pip install pillow
pip install pyclipper”

Any chance you could help out?

The error you are getting is that Pillow (PIL) is not installed. K40 Whisperer will not work on your system until you resolve that issue. I gave you my suggestions on how to resolve that in my previous post.

The easier way to get K40 Whisperer working is to use the bundled windows executable, that gets around all of the python configuration issues. You would need to use that on a windows system.

@xdierockx Are you running this in crosh or in a Linux container? If so what distro? Give verbose details please.

In general pip install pillow I would expect to work, but if whisperer is running python3 then you might need pip3 install pillow But you might have it available in the OS; the command to install it as part of the OS depends on what Linux distro you are running (if you are using a Linux container here, which I think you probably are).

1 Like

$ pip install pillow
Requirement already satisfied: pillow in /home/carpmanfishhead/.local/lib/python2.7/site-packages (6.2.2)

From the original Scorchwork.com I followed the instructions and it worked. So pillow was and has been installed.
As for the container/crosh question I am not totally sure. On the Slate you can turn on Beta Linux and such. So the OS is Chromebook and the Linux runs like an app. And to clarify everything was working as of 3 days ago. Pillow, Linux, Whisperer, Inkscape, etc.

“Beta Linux” is a container.

I don’t know what updates you got, but the python that you are running can’t find the pillow library. Python 3 and Python 2 don’t look at the same files. Why I Quit Advocating Python | mkj’s musings

Have you tried the pip3 install pillow that I suggested before?

1 Like

pip3 install pillow
-bash: pip3: command not found

pip install pillow
Requirement already satisfied: pillow in /home/carpmanfishhead/.local/lib/python2.7/site-packages (6.2.2)

In theory its installed no? I don’t understand how it changed overnight. From working to not.

I hear that you don’t understand how it changed overnight. Repeating it doesn’t make it easier for anyone else to help figure things out.

There can be more than one version of python installed. Each version has its own set of libraries.

If the version of python that is running whisperer isn’t the same version that has pillow installed, you would get the symptom you ran into.

So the next step is to figure that out.

Start by running these commands:

which python
head -1 k40_whisperer.py

Paste the output here.

1 Like

I apologize for repeating it. Just ended up being another question I guess so it was frustrating. Like I got an update and now I don’t know how to update the code. That is what I feel happened. If that makes sense?

carpmanfishhead@penguin:~/K40_Whisperer-0.55_src$ which python
/usr/bin/python
carpmanfishhead@penguin:~/K40_Whisperer-0.55_src$ head -1 k40_whisperer.py
#!/usr/bin/python

$ python --version
Python 2.7.16

OK, one more test:

python -c 'from PIL import Image'

Does that give any errors? If so, I wonder whether the local install is broken. In that case, you could try at least two things along the lines of “turning it off and back on again”. The first would be to uninstall and reinstall PIL:

pip uninstall pillow
pip install pillow

You could be more extreme and remove the entire .local directory, and then start over on the install, with

pip install lxml
pip install pyusb
pip install pillow
pip install pyclipper

You might also install those components on the underlying OS instead of with pip. The default distribution on the “Beta Linux” on a chrome device is based on debian, so I think the commands would be something like:

sudo apt-get install python-lxml python-usb python-pil python-pyclipper

My background is Red Hat, and the one chrome device in the house (which someone else is using anyway) has Fedora installed instead of debian, so I can’t easily provide precise guidance. But if you are able to install system components, they should stay in sync with python through upgrades. Might be worth a try.

1 Like

Nothing happens with
python -c ‘from PIL import Image’
will try the other options again. I have tried them so far but maybe I flubbed some letters. Also there is a very specific part of the instructions where you have to make it recognize the USB port with LSUSB and I feel maybe that is where it is going wrong.
5. Create a udev control file four your laser cutter as root (i used nano because that’s the program I have) will use gedit in this example): sudo nano /etc/udev/rules.d/97-ctc-lasercutter.rules

Put the following text into the file and replace [VENDOR ID] and [PRODUCT ID] with the information you obtained from lsusb:
SUBSYSTEM==“usb”, ATTRS{idVendor}==“1a86”, ATTRS{idProduct}==“5512”, ENV{DEVTYPE}==“usb_device”, MODE=“0664”, GROUP="lasercutter"

{{{Bus 001 Device 002: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter}}}
Now save the file.
I truly appreciate you taking the time to even try. Imagine me trying to help you fix your motorcycle engine through typing. Heh

No errors from that command! That’s fascinating! Yet the same line has an error inside whisperer.

I don’t see how the udev rule would be responsible for this.

Oh!

Are you running python k40_whisperer.py or sudo python k40_whisperer.py ?