0

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

Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58

1 Answers1

0

Did you try that? Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

the two top answers were to:

pip uninstall -y enum34

OR

unset PYTHONPATH
gil tayar
  • 1
  • 1
  • Neither of those fix the problem. I was able to download s3cmd from the website and run it directly with no issues, so it's not a s3cmd issue. It might be a brew issue. – Roger Gilbrat Mar 23 '20 at 23:33