importerror no module named queue

Почему выдает когда дохожу до команды закачки файлов из библиотеки wget и requests вот ошибка:

1 Ответы

Проблема решена методом импорта модуля из multiproccessing импортировали модуль queue!

Подпишись на канал!

Новые видеоуроки, книги и полезные статьи для python программистов!

Posted by: admin April 4, 2018 Leave a comment

I am trying to import requests module, but I got this error
my python version is 3.4 running on ubuntu 14.04

Queue is in the multiprocessing module so:

import queue is lowercase q in Python 3.

Change Q to q and it will be fine.

I solve the problem my issue was I had file named queue.py in the same directory

I too had this problem with the “requests” module. Then I figured it out that you have to edit the “urllib3” module manually.

open C:UsersHpAppDataLocalProgramsPythonPython35Libsite-packagesurllib3packages and put the first line of six.py the following statement:

Remember to save it, then you are done!

You need install Queuelib either via the Python Package Index (PyPI) or from source.

To install using pip:-

To install using easy_install:-

If you have downloaded a source tarball you can install it by running the following (as root):-

I am trying to import requests module, but I got this error my python version is 3.4 running on ubuntu 14.04

7 Answers 7

import queue is lowercase q in Python 3.

Change Q to q and it will be fine.

Queue is in the multiprocessing module so:

I solve the problem my issue was I had file named queue.py in the same directory

It’s because of the Python version. In Python 3 it’s import Queue as queue ; on the contrary in Python 2.x it’s import queue . If you want it for both environments you may use something below as mentioned here

In my case it should be:

from multiprocessing import JoinableQueue

Since in python2, Queue has methods like .task_done() , but in python3 multiprocessing.Queue doesn’t have this method, and multiprocessing.JoinableQueue does.

I run into the same problem and learn that queue module defines classes and exceptions, that defines the public methods (Queue Objects).

You need install Queuelib either via the Python Package Index (PyPI) or from source.

To install using pip:-

To install using easy_install:-

If you have downloaded a source tarball you can install it by running the following (as root):-

Источник: computermaker.info

Техника и Гаджеты
Добавить комментарий