A
A
Alexey Poloz2018-02-04 21:25:16
Python
Alexey Poloz, 2018-02-04 21:25:16

Python How to install the Queue library?

trying to run the code:

import Queue
q = Queue.Queue()

I get an error: ModuleNotFoundError: No module named 'Queue'
I'm trying to install the library:
>>> pip install Queue
Collecting Queue
  Could not find a version that satisfies the requirement Queue (from versions: )
No matching distribution found for Queue

Google:
1) not working
https://stackoverflow.com/questions/46363871/no-mo...
try:
    import queue
except ImportError:
    import Queue as queue

2) doesn't work
https://stackoverflow.com/questions/33432426/impor...
from multiprocessing import Queue
3) tried to update pip, the latest
version is python 3.6

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kovalev, 2021-04-03
@Tungsteniac

Install the module with pip , capitalize the module name.
pip install queue
Import the module like this:
from queue import Queue

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question