ImportError: No module named queue

Posted on
Sun Jul 25, 2021 10:37 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

ImportError: No module named queue

Hi Dave

I am getting the following error:

Starting plugin "Matplotlib 0.9.50" (pid 96854)
Matplotlib Error Error in plugin execution InitializeMain:

Traceback (most recent call last):
File "plugin.py", line 72, in <module>
ImportError: No module named queue

Stopping plugin "Matplotlib 0.9.50" (pid 96854)
Stopped plugin "Matplotlib 0.9.50"


I have deleted the plugin and preference file, and reinstalled, and the error still occurs.

Thanks
Marcus
Indigo 2021.1.0

Posted on
Mon Jul 26, 2021 4:25 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: ImportError: No module named queue

Okay, that's a bit of a strange one. The Python queue library is a standard library and should be included with every Python install. Please try these steps to see if it solves the issue:

  1. Restart the Indigo server computer (and thus the Indigo Server). Do you still get the error?
  2. From within Indigo, select the Plugins menu and then Open Scripting Shell. At the prompt, enter `import queue` (without the single quotes). Do you still get the same error? Enter `exit()` and them `CMD-Q` to close the shell.
  3. Start the Terminal app and enter `python'. Do you get a Python 2.7 instance? If yes, enter `import queue`. Do you get the same error? Enter `exit() and then `CMD-Q` to close the shell.
Let me know how these steps go and then we'll work from there.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jul 26, 2021 7:34 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

Restart the Indigo server computer (and thus the Indigo Server). Do you still get the error?

YES



From within Indigo, select the Plugins menu and then Open Scripting Shell. At the prompt, enter `import queue` (without the single quotes). Do you still get the same error? Enter `exit()` and them `CMD-Q` to close the shell.

import queue
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named queue
>>>





Start the Terminal app and enter `python'. Do you get a Python 2.7 instance? If yes, enter `import queue`. Do you get the same error? Enter `exit() and then `CMD-Q` to close the shell.
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import queue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named queue
>>>

Posted on
Mon Jul 26, 2021 7:58 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

I have found this online

The Queue module has been renamed to queue in Python 3.


if I type "import Queue" I do not get the errors seen above
Python 2.7.16 (default, Mar 25 2021, 18:52:10)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)]
Connected to Indigo Server v2021.1.0, api v2.5 (localhost:1176)
>>> import Queue
>>>

Posted on
Mon Jul 26, 2021 8:43 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: ImportError: No module named queue

Are you by any chance running on a case-sensitive file system?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jul 26, 2021 8:45 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: ImportError: No module named queue

In Disk Utility, what does it show?
Attachments
Screen Shot 2021-07-26 at 10.45.02 PM.png
Screen Shot 2021-07-26 at 10.45.02 PM.png (44.86 KiB) Viewed 4618 times

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jul 26, 2021 9:20 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

APFS Volume . APFS


My quick test to create the same folder with same name but in different cases, shows that the file system being used is not case sensitive

Posted on
Mon Jul 26, 2021 10:08 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: ImportError: No module named queue

You appear to have a Python version issue:

Bleasel wrote:
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)


This is a very old Python and shouldn't be on more recent macOS versions that are completely patched with Apple updates.

Bleasel wrote:
Python 2.7.16 (default, Mar 25 2021, 18:52:10)


I believe that in 2.7.16, the Queue module has at least been aliased to queue since I can import queue on all 2.7.16 instances I have on my various devices. It's possible (maybe likely) that they did that in the later dot releases of Python 2 to help with Python 3 migration, and that earlier versions of Python 2 may not have done it. I further believe that if your OS has all it's security updates, that you likely have 2.7.16 installed unless you're on a very old OS. High Sierra and newer, for instance, has it.

Dave, if you want to support older Python versions, I'd recommend:

Code: Select all
try:
    import queue
except:
    import Queue as queue


I believe that most of the module features are the same so hopefully that'll work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jul 27, 2021 4:57 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: ImportError: No module named queue

Thanks Jay. I came up with the same solution and will push it out as a dot release. However, I want to also add a note of caution about whether this change will allow the Matplotlib plugin to run error free on Python 2.7.6. The Matplotlib library is version-sensitive and is not stable across Python versions and Matplotlib versions. For example, recent releases of macOS have irretrievably broken the Polar Chart device (which I'm hoping will be fixed in the eventual migration to Python 3).

So, I will make a change to silence the `module not found error`, but can't guarantee that the plugin will work on Python 2.7.6.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jul 27, 2021 4:56 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

Thanks


I am running mac 10.14.6 (that is the latest version that my Mac Pro (Mid 2012) with upgraded Graphics card will run.)

Posted on
Tue Jul 27, 2021 10:15 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

New version 0.9.51 seems to have removed the error


Many Thanks

MODERATOR EDIT: Corrects version number.

Posted on
Wed Jul 28, 2021 5:04 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: ImportError: No module named queue

Terrific. Thanks for reporting back.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Jul 28, 2021 10:27 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: ImportError: No module named queue

Bleasel wrote:
I am running mac 10.14.6 (that is the latest version that my Mac Pro (Mid 2012) with upgraded Graphics card will run.)


Unfortunately, the basic macOS version isn't enough since Apple doesn't increment the dot releases for each security update, and that's likely where Python gets updated. To find out the more specific macOS release, open the System Information app, select the Software item in the outline view on the left, and look for this line:

Code: Select all
System Version:   macOS 10.14.6 (18G9216)


That last part is the build number. The one above has all the Mojave security updates installed and it has Python 2.7.16. If you don't have all the security updates installed, you should if for no other reason that to make sure your Mac is as secure as possible.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jul 28, 2021 7:15 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

I seem to have the same build number, but an earlier version of Python then.



System Version: macOS 10.14.6 (18G9216)
Kernel Version: Darwin 18.7.0

Posted on
Wed Jul 28, 2021 8:04 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: ImportError: No module named queue

Latest security update

System Version: macOS 10.14.6 (18G9323)


But no change in python version
Last login: Thu Jul 29 11:50:20 on console
XXXXXXXXXXXXX:~ X$ python
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest