※こちらは旧サイトです(新サイトはこちら)
pyenv virtualenv 3.5.2 xxxxx
した環境で、import curses
したらおこられた
$ python test.py
Traceback (most recent call last):
File "test.py", line 4, in <module>
import curses
File "/home/username/.anyenv/envs/pyenv/versions/3.5.2/lib/python3.5/curses/__init__.py", line 13, in <module>
from _curses import *
ImportError: No module named '_curses'
The C modules of Python is not a script file and it must not work even if you just copy it. You must rebuild the Python and modules against system's curses library. The lack of library or development headers of curses (e.g. libncursesw5-dev) might causes those issues. Please confirm if you have enough package for the module.
という事なので、pythonの再構築が必要らしい
// cursesのライブラリ類インストール
$ sudo apt-get install libncurses5 libncurses5-dev libncursesw5
// install済みの物を1回削除して再構築
$ pyenv uninstall 3.5.2
$ pyenv install 3.5.2
$ pyenv virtualenv 3.5.2 xxxxx