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

ImportError: no module named mac #68

Closed
larryy opened this issue May 28, 2022 · 6 comments
Closed

ImportError: no module named mac #68

larryy opened this issue May 28, 2022 · 6 comments

Comments

@larryy
Copy link

larryy commented May 28, 2022

After cloning the directory, entering it, and typing 'pip install .' I got what seemed to be a successful build and install, ending in:

Successfully built Send2Trash
Installing collected packages: Send2Trash
Successfully installed Send2Trash-1.8.1b0

But when I try to run my Python 2.7 script I get an error message:

Traceback (most recent call last):
  File "/Users/larryy/Dropbox/src/file_rename.py", line 8, in <module>
    from send2trash import send2trash
  File "/usr/local/lib/python2.7/site-packages/send2trash/__init__.py", line 12, in <module>
    from .mac import send2trash
ImportError: No module named mac

As shown, the line of code in question is a standard import:

from send2trash import send2trash

This is macOS Monterey 12.4 (latest) and the latest Send2Trash (1.8.1b0). Apologies if I've just done something stupid setting things up.

@arsenetar
Copy link
Owner

Likely an issue related to d37197c although there should not be issues... I recommend trying the 1.8.1b0 tag instead of the master branch. to see if that resolves the issue.

@arsenetar
Copy link
Owner

This should be good now, I needed to update the setup.cfg.

@larryy
Copy link
Author

larryy commented Jun 1, 2022 via email

@arsenetar
Copy link
Owner

Yeah, I think you are running into a previous issue #51 that has a fix for newer python versions. This issue is due to a change in newer macOS versions.
Options really are to either use python 3.6+, in which the newer implementation will be used here and avoid that issue. Alternatively, I have noticed that it is possible to "fix" this issue in python by installing a newer version of python3 for macOS via the installers at https://www.python.org/downloads/macos/ as they include an option that seems to fix this issue across all python versions.

@larryy
Copy link
Author

larryy commented Jun 1, 2022 via email

@arsenetar
Copy link
Owner

Yeah, I don't really have anything else then, installing python 3.9.2 back when I was first troubleshooting the symbol not found issue somehow "fixed" the system pythons on my development mac which no longer has this issue to date with any of the three python versions present. I would encourage using a newer version of python if you can.

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

2 participants