Discussion:
[Fab-user] Python Compatible Question
Razer
2017-02-24 14:28:40 UTC
Permalink
Hi,

I've encountered a problem while I have multiple python version installed
on my environment. which python and python version all points to 2.7,
however, when I try to run fabric, it goes to 3.6 folder to search the
module. How can I solve this?
Traceback (most recent call last):
File "/usr/bin/fab", line 7, in <module>
from fabric.main import main
File "/usr/lib64/python3.6/site-packages/fabric/main.py", line 13, in
<module>
from operator import isMappingType
ImportError: cannot import name 'isMappingType'


Thanks,
Razer
Jeff Forcier
2017-02-24 17:30:38 UTC
Permalink
Perhaps you installed your /usr/bin/fab while running under Python 3? Check
the 'shebang' line (#!/some/path/here) at the top of /usr/bin/fab, it may
provide a clue.

If it's e.g. '/usr/bin/env python' then it should use the same python as
'which python' points to, but if it is something like '/usr/bin/python3',
that would cause the behavior you're seeing.

If that doesn't clear it up you should let us know more details about your
operating system version & how exactly you obtained/installed Fabric :)
Post by Razer
Hi,
I've encountered a problem while I have multiple python version installed
on my environment. which python and python version all points to 2.7,
however, when I try to run fabric, it goes to 3.6 folder to search the
module. How can I solve this?
File "/usr/bin/fab", line 7, in <module>
from fabric.main import main
File "/usr/lib64/python3.6/site-packages/fabric/main.py", line 13, in
<module>
from operator import isMappingType
ImportError: cannot import name 'isMappingType'
Thanks,
Razer
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
Loading...