ImportError: No module named _io in ubuntu 14.04

I had the same problem. This happened in Ubuntu – 14.04 and Virtual environment’s Python version – 2.7.3

After spending a day in debugging, posting my answer here, hope it helps for future visitors.

I found that io.py is invoking _io module. I think _io module is internal to the interpreter, so, just replacing the python binary in the environment alone with the newer version should fix.

(In my case, Cloudera Manager 5.x Agent’s virtualenv on ubuntu 14.04 was using python interpreter 2.7.3, replaced it with 2.7.6.

echo "Using " && python2.7 --version
mv myenv/bin/python myenv/bin/python.bak;
cp `which python2.7` myenv/bin/python

When a new virtualenv is created, it uses updated python binary from the system. Hence, that explains the accepted answer in the thread.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)