Tag Archives: ModuleNotFoundError: No module named ‘Queue’

Python solves the problem of modulenotfounderror: no module named ‘queue’

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

We know that there are some incompatibilities between the two versions of python2 and python3. The introduction of queue in python3 will report this problem

In Python 3, it is introduced as follows:

1 import queue

In Python 2, we should introduce this method:

1 import Queue

For compatibility, it can be written as follows:

1 import sys
2 if sys.version > '3':
3     import queue as Queue
4 else:
5     import Queue

Python solves the problem of modulenotfounderror: no module named ‘queue’

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

Python solves the problem of modulenotfoundererror: no module named ‘queue’

Reference article:

(1) Python solves the problem of modulenotfounderror: no module named ‘queue’

(2) https://www.cnblogs.com/Sweettesting/p/11137965.html

Let’s make a note.