简体   繁体   English

Python3.8 导入错误 No module name tqdm found

[英]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.

相关问题 python3.8下模块多处理错误 - error with module multiprocessing under python3.8 如何解决linux上python3.8中numpy的导入错误? - How to resolve the import error for numpy in python3.8 on linux? 如何修复python3.8中的错误“没有名为'builtin'的模块” - how to fix error "No module named 'builtin'" in python3.8 在python3.8中导入pyttsx3发现报错 - importing pyttsx3 in python3.8 and found an error 安装python3.8但找不到包含文件夹 - install python3.8 but not found include folders Windows 中没有名为“tkinter”(Python3.8)的模块 - No module named 'tkinter' (Python3.8) in Windows 导入错误:无法从“distutils”(/usr/lib/python3.8/distutils/__init__.py)导入名称“sysconfig” - ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py) 错误。 无法在 Vercel 上找到运行时 python3.8 的二进制 python3.8 - Error! Unable to find binary python3.8 for runtime python3.8 on Vercel “导入错误:找不到合适的图像”使用 BeautifulSoup 和 Python3.8 - "ImportError: no suitable image found" using BeautifulSoup and Python3.8 ModuleNotFoundError:没有名为“django”的模块,具有虚拟环境 Python3.8 - ModuleNotFoundError: No module named 'django', with virtual environment Python3.8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM