pythonpython-3.ximporterrorlaspy

How to fix SimpleQueue error when importing the Laspy module in Python?


When importing Laspy I get the following error:

import laspy as lp

ImportError: cannot import name 'SimpleQueue'

The error occurs in the following line of the Laspy module: from queue import Queue, SimpleQueue

I tried updating Python because it was likely to be a version issue, but this did not work. Then I tried updating Laspy, conda and lastly I updated everything. This did not work. I am using these versions: python: 3.6.13 laspy: 2.3.0 (25/10/2022)

(I am working in Jupyter Notebook.)

How can I fix this error?


Solution

  • SimpleQueue is new in Python 3.7.

    You'll need to use Python 3.7 or newer to use laspy – and you should, anyway, since Python 3.6's end-of-life was 1 year and 3 months ago (23 Dec 2021).

    Alternately, you can downgrade laspy to a version that does support Python 3.6; according to this commit versions older than 2.2.0 should be compatible.