简体   繁体   中英

Python3.8 Import Error No module name tqdm found

I'm trying to run this python project on my linux machine. I did setup everything according to the requirement but when I try to run the project with the ./generate.sh executable file I got the following error.

Import Error: No module name tqdm found .

Here are the imports exists in file.

import os.path as path
import ast
from glob import glob
import signal
import imp
import logging
import time
import numpy as np
import socket
import tqdm
import sys
import click
import tensorflow as tf
from tensorflow.python.client import timeline

I check with pip3 show tqdm command it shows me the package detail. I also try to uninstall and install again the project but got no luck.

If i remove the tqdm import from the file then it shows me this error.

  File "./run.py", line 16, in <module>
    import click
ImportError: No module named click

Can someone guide me what I'm doing wrong here?

it seems you are importing it wrong, from tqdm docs:

from tqdm import tqdm

I've checked it for both python2 and 3 and this is the way to use it.

The project you are trying to use at least 3 years old, so maybe things have changed since then, so if it wont work for you even with proper import statement you can simply remove it.

Every loop working with tqdm will work without it as well. For example:

from tqdm import tqdm

for i in tqdm(range(10000)):
    pass

is the same as:

for i in range(10000)):
    pass

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM