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

MacOS homebrew install throws "ModuleNotFoundError: No module named 'tqdm'" #227

Open
wtangofoxtrot opened this issue Dec 28, 2023 · 11 comments

Comments

@wtangofoxtrot
Copy link

This appears to have been solved already in #170 ?

Macbock pro m2 running 13.6.3

% brew install phockup
phockup 1.12.0 is already installed but outdated (so it will be upgraded).
==> Fetching ivandokov/contrib/phockup
==> Downloading https://files.pythonhosted.org/packages/62/06/d5604a70d160f6a6ca5fd2ba25597c24abd5c5ca5f437263d177ac242308/tqdm-4.66.1.tar.gz
Already downloaded: /Users/wtangofoxtrot/Library/Caches/Homebrew/downloads/2e64e0824967f2e1dfb0465e339bc6741b791491c14679cbb6922e4622d649ea--tqdm-4.66.1.tar.gz
==> Downloading https://github.com/ivandokov/phockup/archive/1.13.0.tar.gz
==> Downloading from https://codeload.github.com/ivandokov/phockup/tar.gz/refs/tags/1.13.0
##O=- #     #
==> Upgrading ivandokov/contrib/phockup
  1.12.0 -> 1.13.0

==> /opt/homebrew/opt/python@3.11/bin/python3 -m venv --system-site-packages --without-pip /opt/homebrew/Cellar/phockup/1.13.0/libexec
==> /opt/homebrew/opt/python@3.11/bin/python3 -m pip --python=/opt/homebrew/Cellar/phockup/1.13.0/libexec/bin/python install /private/tmp/phockup--tqdm-20231228-62065-37iett/tqdm-4.66.1
🍺  /opt/homebrew/Cellar/phockup/1.13.0: 87 files, 331.5KB, built in 6 seconds
==> Running `brew cleanup phockup`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /opt/homebrew/Cellar/phockup/1.12.0... (91 files, 358.3KB)
Removing: /Users/wtangofoxtrot/Library/Caches/Homebrew/phockup--1.12.0.tar.gz... (25.6KB)

when i run it however i get:

% phockup
Traceback (most recent call last):
  File "/opt/homebrew/bin/phockup", line 11, in <module>
    from src.phockup import Phockup
  File "/opt/homebrew/Cellar/phockup/1.13.0/src/phockup.py", line 11, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

however installing tqdm via pip did not solve the issue:

% pip3 install tqdm
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: tqdm in /Users/wtangofoxtrot/Library/Python/3.9/lib/python/site-packages (4.66.1)

This is because homebrew is using a different python install:

% where python3
/opt/homebrew/bin/python3
/usr/bin/python3

i was able to fix the issue by updating that version of tqdm manually:

% /opt/homebrew/bin/python3 -m pip install tqdm
Collecting tqdm
  Downloading tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.6/57.6 kB 1.7 MB/s eta 0:00:00
Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 5.2 MB/s eta 0:00:00
Installing collected packages: tqdm
Successfully installed tqdm-4.66.1

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: python3.11 -m pip install --upgrade pip

it now works without the missing module:

% phockup
usage: phockup [-h] [-v] [-d DATE] [-m | -l] [-o] [-t] [-y] [-c 1-255] [--maxdepth 1-255] [-r REGEX] [-f DATE_FIELD] [--debug | --quiet | --progress] [--log LOG] [--file-type image|video]
               [--no-date-dir NO_DATE_DIR] [--skip-unknown] [--movedel] [--rmdirs] [--output_prefix OUTPUT_PREFIX] [--output_suffix OUTPUT_SUFFIX] [--from-date FROM_DATE] [--to-date TO_DATE]
               INPUTDIR OUTPUTDIR
phockup: error: the following arguments are required: INPUTDIR, OUTPUTDIR

Is this something that needs to be fixed in homebrew ?

@ivandokov
Copy link
Owner

ivandokov commented Dec 28, 2023 via email

@wtangofoxtrot
Copy link
Author

Hey @ivandokov I did try re-installing a few times via homebrew but still ran into the issue with the missing tqdm module.

@ivandokov
Copy link
Owner

Have you updated homebrew's formulas repository as the fix is inside the formula, not in the software.

@JamesABaker
Copy link

I have the same issue as another user #170 (comment).

The snap package seems to have the same missing module.

$ snap install phockup
phockup 1.7.1 from Ivan Dokov (dokov) installed
$ phockup --help
Traceback (most recent call last):
  File "/snap/phockup/407/phockup.py", line 11, in <module>
    from src.phockup import Phockup
  File "/snap/phockup/407/src/phockup.py", line 9, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'
$ pip list | grep tqdm
tqdm                               4.50.2

Would you like me to open a separate issue relating to the snap package to keep this issue related only to the homebrew package?

@ivandokov
Copy link
Owner

ivandokov commented Jan 12, 2024

@JamesABaker did you updated the formula before (re)installing?

The snap package is pretty outdated #153

@JamesABaker
Copy link

Works from brew! It sounds like the snap is just out of date.

@maxexcloo
Copy link

Had the same problem on a fresh install just now, using the guide in the readme...

@ivandokov
Copy link
Owner

ivandokov commented Feb 19, 2024

@maxexcloo did you have the tap installed just before brew install phockup or you had it previously installed (using older version of the formula).

@maxexcloo
Copy link

No, completely new install, I added the tap and then installed the cask from the tap as mentioned in the readme…

@jasonish
Copy link

Same here. Just install Brew now, added the tap, install phockup and:

Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/phockup", line 11, in <module>
    from src.phockup import Phockup
  File "/home/linuxbrew/.linuxbrew/Cellar/phockup/1.13.0/src/phockup.py", line 11, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

I get the same error using the Snap.

@barbich
Copy link

barbich commented May 23, 2024

Hi
I've been having the same issue for some time also.
Worked around it the same way as @wtangofoxtrot did.

But just got a fresh new Mac, with a completely fresh install for brew and therefore phockup.
Same error as others:

MBA-seb:~ seb$ phockup
Traceback (most recent call last):
  File "/opt/homebrew/bin/phockup", line 11, in <module>
    from src.phockup import Phockup
  File "/opt/homebrew/Cellar/phockup/1.13.0/src/phockup.py", line 11, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'
MBA-seb:~ seb$

I digged into it a bit more and noticed that as phockup is not installed as a "clean" python app, and therefore the shebang for phockup is "incorrect" :

MBA-seb:~ seb$ head -n +1 /opt/homebrew/bin/phockup
#!/usr/bin/env python3

which should be something like:

/opt/homebrew/Cellar/phockup/1.13.0/libexec/bin/python

In other words,I believe, the brew installation is not using the the venv installation of python and tqdm but is using the system installation which wont contain the resources required ...

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