0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Mac で python2.7入れ直し

Last updated at Posted at 2021-04-06

なぜ入れ直したのか

imagemagick入れただけなのに、awsコマンドがエラーになった
md5…
修正しようとしたが、無理そうだったので入れ直した

ERROR:root:code for hash md5 was not found.
File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
...
ImportError: cannot import name md5

Macでpython2系を入れ直す

いろいろやり方ありそうだったのですが、うまく動かず下記で解消
md5はopenssl関連でエラーになっているらしいので、まずinstall

brew install openssl

pythonをアンインストール
インストール方法を確認して、そこから勘でコマンドを書いたら動いた

brew uninstall --ignore-dependencies python@2.rb

pythonインストール
私の環境、wgetが入ってなかった…
インストール方法は下記参考にしました
https://stackoverflow.com/questions/60298514/how-to-reinstall-python2-from-homebrew

brew install wget
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/86a44a0a552c673a05f11018459c9f5faae3becc/Formula/python@2.rb
brew install python@2.rb
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?