[英]Python3.8 Import Error No module name tqdm found
I'm trying to run this python project on my linux machine.我正在尝试在我的 linux 机器上运行这个python 项目。 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.
我确实根据要求设置了所有内容,但是当我尝试使用 ./generate.sh 可执行文件运行项目时,出现以下错误。
Import Error: No module name tqdm found
. 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.我使用
pip3 show tqdm
命令检查它向我显示包的详细信息。 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.如果我从文件中删除了tqdm导入,则会显示此错误。
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:从 tqdm 文档中,您似乎错误地导入了它:
from tqdm import tqdm
I've checked it for both python2 and 3 and this is the way to use it.我已经检查了 python2 和 3,这是使用它的方法。
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.您尝试使用的项目至少已有 3 年历史,所以从那时起可能情况发生了变化,因此如果即使使用正确的导入语句它也不适合您,您可以简单地将其删除。
Every loop working with tqdm will work without it as well.每个使用 tqdm 的循环也可以在没有它的情况下工作。 For example:
例如:
from tqdm import tqdm
for i in tqdm(range(10000)):
pass
is the same as:是相同的:
for i in range(10000)):
pass
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.