Python module import errors on devel, Ubuntu 16.04

I was looking to start work on a new module, start writing tests, after rebase-ing devel I’m now getting an error when trying to run Ansible from source on Ubuntu 16.04. This error has only started occurring in the past week, I’ve run from devel previously to test other modules on this same host. I do have a deb install of ansible on this machine also, but haven’t had any problems in the past running a source version of ansible.

stephen@computer:~/workspace/ansible$ git submodule update --init --recursive
stephen@computer:~/workspace/ansible$ source hacking/env-setup
running egg_info
creating lib/ansible.egg-info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
writing manifest file ‘lib/ansible.egg-info/SOURCES.txt’
reading manifest file ‘lib/ansible.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘v2’
no previously-included directories found matching ‘docsite’
no previously-included directories found matching ‘ticket_stubs’
no previously-included directories found matching ‘packaging’
no previously-included directories found matching ‘test’
no previously-included directories found matching ‘hacking’
no previously-included directories found matching ‘lib/ansible/modules/core/.git’
no previously-included directories found matching ‘lib/ansible/modules/extras/.git’
writing manifest file ‘lib/ansible.egg-info/SOURCES.txt’

Setting up Ansible to run out of checkout…

PATH=/home/stephen/workspace/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PYTHONPATH=/home/stephen/workspace/ansible/lib:
MANPATH=/home/stephen/workspace/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

stephen@computer:~/workspace/ansible$ ansible --version
Traceback (most recent call last):
File “/home/stephen/workspace/ansible/bin/ansible”, line 46, in
from ansible.module_utils._text import to_text
ImportError: No module named _text
stephen@computer:~/workspace/ansible$ which ansible
/home/stephen/workspace/ansible/bin/ansible

stephen@computer:~/workspace/ansible$ echo $PYTHONPATH
/home/stephen/workspace/ansible/lib:

Thanks @agaffney for your help, pity about the freenode ddos.

https://github.com/ansible/ansible/issues/16435 I came across this bug, put I don’t think that’s the issue.

line 46 in bin/ansible
from ansible.module_utils._text import to_text

I attempted then to try importing modules from the python interpreter,
stephen@computer:~/workspace/ansible$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from ansible.utils.display import Display
import itertools
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import env_fallback, get_exception
from ansible.module_utils.netcli import Cli, Command
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named netcli
from ansible.module_utils.netcfg import Config
Traceback (most recent call last):
File “”, line 1, in
ImportError: cannot import name Config
from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE
from ansible.module_utils.six import string_types, text_type
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named six
from ansible.module_utils.six.moves import zip
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named six.moves
import operator
import sys
import six
import ansible.module_utils.six
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named six
import ansible.module_utils.ec2

I’m not a python programmer and may just be looking at this the wrong way.