Adding a call to append an appropraite library location to the python code seems to fix the problem. Any views on why this path information is lost when would be welcome. import sys # append path to enable impot of smbus sys.path.append('/home/pi/.local/lib/python2.7/site-packages')...
import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' Environment Ansible Tower Ansible Engine
in <module> from yum.Errors import RepoError, YumBaseError File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 51, in <module> import config File "/usr/lib/python2.6/site-packages/yum/config.py", line 40, in <module> import rpmUtils.transaction ImportError: No module named...
In the third, fourth and fifth case, theimportstatement has to do more work: it has to assign to (potentially) multiple names, which it has to get from the module object. The__import__()function can only return one object, and there's no real reason to make it retrieve each of tho...
>> some standard library python module but not my external module. Yet the >> application is working fine, importing all the required modules and >> everything. >> >> In my application if I import those modules and print them to see the ...