2
1

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.

「amazon-linux-extras」→「No module named amazon_linux_extras」になる場合の対処法

Posted at

pyenvがインストールされ、pythonのバージョンを変えていると、以下のようにamazon-linux-extrasは使えないそうです。
なので、使えるようにしてあげます。

現在のエラー

$ amazon-linux-extras
/home/ec2-user/.pyenv/versions/3.7.0/bin/python: No module named amazon_linux_extras

解決策

pyenvで、python3.7.0にしている人はコチラ。

ln -s /lib/python2.7/site-packages/amazon_linux_extras ~/.pyenv/versions/3.7.0/lib/python3.7/site-packages/

pyenvで、python3.7.5にしている人はコチラ。

ln -s /lib/python2.7/site-packages/amazon_linux_extras ~/.pyenv/versions/3.7.5/lib/python3.7/site-packages/

他のバージョンの人はこれを参考に書き換えてください。
これで「amazon-linux-extras」周辺のコードは使えます。✌️

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?