Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'tqdm.auto' #16

Closed
zamirkhan opened this issue Apr 9, 2020 · 7 comments
Closed

ModuleNotFoundError: No module named 'tqdm.auto' #16

zamirkhan opened this issue Apr 9, 2020 · 7 comments

Comments

@zamirkhan
Copy link

zamirkhan commented Apr 9, 2020

I've been using v1.2 for a while with no issues (along with tqdm 4.45.0) and recently upgraded p_tqdm and got this error. Didn't go away until I downgraded back to 1.2.

    from p_tqdm import p_imap
  File "/usr/local/lib/python3.7/site-packages/p_tqdm/__init__.py", line 1, in <module>
    from p_tqdm.p_tqdm import p_map, p_imap, p_umap, p_uimap, t_map, t_imap
  File "/usr/local/lib/python3.7/site-packages/p_tqdm/p_tqdm.py", line 15, in <module>
    from tqdm.auto import tqdm
ModuleNotFoundError: No module named 'tqdm.auto'

This is on a Docker image where I'm installing a bunch of things, but mostly relevant would be:

ENV TQDM_VERSION 4.45.0
ENV P_TQDM_VERSION 1.2

...

RUN pip install -U p_tqdm==$P_TQDM_VERSION
RUN pip install -U tqdm==$TQDM_VERSION

Increasing the version beyond 1.2 leads to the above error. Any idea what's going wrong?

@swansonk14
Copy link
Owner

Hi @zamirkhan, thank you for using p_tqdm and for bringing up the issue! The problem stems from a change that was introduced in this PR #7 which changed the import from from tqdm import tqdm to from tqdm.auto import tqdm in order to enable tqdm bars to function as widgets in Jupyter notebooks.

I would have imagined that the problem is that you're using an old tqdm version which doesn't have tqdm.auto, but 4.45.0 is the same version I'm using and it seems to work fine for me.

Could you testing the version of the tqdm installation on the docker image to make sure it's installing correctly? Specifically can you try:

$ python
>>> import tqdm
>>> tqdm.__version__
>>> import tqdm.auto

to make sure tqdm is actually installing as version 4.45.0 and to check if you can import tqdm.auto?

If it really is installing the correct version of tqdm and p_tqdm still isn't working, please let me know. Worst case I can always add a try/except around the tqdm.auto import and revert to tqdm when needed, but I'm curious why this isn't working for you.

@zamirkhan
Copy link
Author

Thanks for the quick response, @swansonk14 ! You were absolutely right, the issue was that another package was uninstalling p_tqdm 4.45.0 and installing an older version (grrr! I'm not super experienced with Python, but that feels like a bad package installer thing to do). Moving my tqdm and p_tqdm installs to be after that bad-behaving package solved the issue.

@swansonk14
Copy link
Owner

Perfect, I'm glad that fixed the issue! Yeah it is really frustrating that Python sometimes overrides package versions due to other package requirements, but I'm glad it's working now!

@ankitladva11
Copy link

This solution is nor worked for me,what else I do?

@Ekko-G0d
Copy link

刚刚我遇到了这个报错,并成功解决解决了这个问题,给大家分享一下,仅供参考。
1.卸载老版本的tqdm,并手动删除调用该项目的低版本文件,比如我的是stable diffusion中的tqdm-4.11.2 和 tqdm 文件夹(记住文件夹所在位置,).
[code=html] pip uninstall tqdm
[/code]
2.安装tqdm的最新版本,然后找到python目录下对应的tqdm-4.45.0 以及 tqdm 文件夹,手动复制到刚刚删除文件夹的地方。
[code=html] pip install tqdm
[/code]
问题解决!
使用到的功能是powershell
文件夹搜索工具everything
希望能对你有所帮助

@asantanna
Copy link

This is the only thing that worked for me!!!! Thanks!!!

@Curiouscubb
Copy link

Curiouscubb commented Sep 4, 2023

刚刚我遇到了这个报错,并成功解决解决了这个问题,给大家分享一下,仅供参考。 1.卸载老版本的tqdm,并手动删除调用该项目的低版本文件,比如我的是stable diffusion中的tqdm-4.11.2 和 tqdm 文件夹(记住文件夹所在位置,). [code=html] pip uninstall tqdm [/code] 2.安装tqdm的最新版本,然后找到python目录下对应的tqdm-4.45.0 以及 tqdm 文件夹,手动复制到刚刚删除文件夹的地方。 [code=html] pip install tqdm [/code] 问题解决! 使用到的功能是powershell 文件夹搜索工具everything 希望能对你有所帮助

This solved my issue.. I already have the newest version installed. So I copied from the directory and pasted inside the path\stable-diffusion-webui\venv\Lib\site-packages. and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants