A few weeks ago I had brew update various casks and now I can't run s3cmd. I get the following errors:
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/local/Cellar/s3cmd/2.0.2_3/libexec/bin/../lib/python3.8/site.py", line 703, in <module>
main()
File "/usr/local/Cellar/s3cmd/2.0.2_3/libexec/bin/../lib/python3.8/site.py", line 694, in main
execsitecustomize()
File "/usr/local/Cellar/s3cmd/2.0.2_3/libexec/bin/../lib/python3.8/site.py", line 548, in execsitecustomize
import sitecustomize
File "/usr/local/lib/python2.7/site-packages/sitecustomize.py", line 4, in <module>
import re
File "/usr/local/Cellar/s3cmd/2.0.2_3/libexec/lib/python3.8/re.py", line 143, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Based on the errors, I assumed this is python 3 issue. The Mac comes with python 2.7 and I use a lot of 2.7 python scripts so I don't want to make a system wide change.
Based on some research, it doesn't seem that s3cmd requires python3.
I could be very wrong about it needing python3 and it's some other issue. The rest of my python code runs just fine so it's not a fundamental issues with python and seems to only be s3cmd.
Everything in brew seems to be up to date and I've uninstalled and installed s3cmd miltiple times trying to fix this.
I am running OS X 10.14.6