58

I am running the following pixel recurrent neural network (RNN) code using Python 3.6

import os
import logging

import numpy as np
from tqdm import trange
import tensorflow as tf

from utils import *
from network import Network
from statistic import Statistic

However, there was an error:

ModuleNotFoundError: No module named 'tqdm'

Does anyone know how to solve it?

A. Syam
  • 759
  • 1
  • 6
  • 9

6 Answers6

71

You need to install tqdm module, you can do it by using python pip.

pip install tqdm

for more info tqdm

pushpendra chauhan
  • 2,205
  • 3
  • 20
  • 29
  • 2
    For Anaconda use: `conda install -c conda-forge tqdm`, also for pip3 use: `pip3 install tqdm` – M.Hossein Rahimi Jan 07 '22 at 23:27
  • I'm having the same issue. I have tried "pip install tdqm" and "pip3 install tdqm". But even though the console confirms that it has been installed, python claims it is not. I also tried running this code block `subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'tdqm'])` in python, and the console agrees that tdqm has been installed, but when I try to import it, it cannot find tdqm. I have **not** installed any pip installs before on this PC, though I have done it on another PC that also has Windows 10, where I downloaded python from the same place on both PC. What is the problem? – Hamligt Nov 17 '22 at 07:39
18

For Python 3 as you specified, you use the pip3 command, like so...

pip3 install tqdm

For Python 2, you use pip command, like so...

pip install tqdm

Hope this helps!

Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
7

or you can use conda install -c conda-forge tqdm Sometimes help

ysf
  • 4,634
  • 3
  • 27
  • 29
Nelson Bape
  • 71
  • 1
  • 1
4

In Anaconda this worked for me:

sudo <anaconda path>/bin/python3.6 -m pip install tqdm 

(after your working env is activated)

On my linux machine I substituted <anaconda path> with:

anaconda3

Ubuntu machines:

sudo /usr/bin/python3.5 -m pip install tqdm
Victor
  • 504
  • 3
  • 9
  • **Note:** If you're using Conda then you should install tqdm (and all modules when possible) with Conda itself, not pip. – AMC Mar 29 '20 at 22:22
4

If you have installed it, type :

from tqdm import tqdm

at the beggining of your code

tCot
  • 307
  • 2
  • 7
2

In Anaconda, steps to install the package.

  1. Navigate to ‘Environments” and Search for your package.
  2. That package will be displayed and click on Apply.

Now the package is installed and it can be used right away.

Please share your feedback.

Nages
  • 763
  • 1
  • 9
  • 12