python3 fabric not working

3,143 views
Skip to first unread message

Joshua Wiegand

unread,
Jul 11, 2014, 10:29:07 PM7/11/14
to obey-the-test...@googlegroups.com
I understand that python3 fabric is not recommended for this tutorial, and maybe this is meant for fabric not here. However, I thought someone would be kind enough to help. When I execute the following command: "fab deploy:host=<MY_USER>@dev.joshwiegand.com" I get the following errors...

Traceback (most recent call last):
  File "/home/josh/.venvs/tdd/bin/fab", line 9, in <module>
    load_entry_point('Fabric==1.9.0', 'console_scripts', 'fab')()
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 2431, in load_entry_point
    return ep.load()
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 2147, in load
    ['__name__'])
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/fabric/main.py", line 12, in <module>
    from operator import isMappingType
ImportError: cannot import name 'isMappingType'

If anyone is willing to help with this it would be much appreciated. I would prefer python3 to python2 and it could help fabric with their errors.
Finally, I have completed chapter 9 with python2 fabric, but it is not as fun. :-) Thanks for anyone willing to help.

Harry Percival

unread,
Jul 12, 2014, 11:47:13 AM7/12/14
to Joshua Wiegand, obey-the-test...@googlegroups.com
Cool. where did you install python3 fabric from?


--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
------------------------------
Harry J.W. Percival
------------------------------
Twitter: @hjwp
Mobile:  +44 (0) 78877 02511
Skype:         harry.percival

Joshua Wiegand

unread,
Jul 12, 2014, 12:21:19 PM7/12/14
to obey-the-test...@googlegroups.com, joshwi...@gmail.com, hj...@cantab.net
Just use pip3 install fabric and everything installs fine. However, clearly not working properly.


On Saturday, July 12, 2014 11:47:13 AM UTC-4, Harry Percival wrote:
Cool. where did you install python3 fabric from?
On 12 July 2014 03:29, Joshua Wiegand <joshwi...@gmail.com> wrote:
I understand that python3 fabric is not recommended for this tutorial, and maybe this is meant for fabric not here. However, I thought someone would be kind enough to help. When I execute the following command: "fab deploy:host=<MY_USER>@dev.joshwiegand.com" I get the following errors...

Traceback (most recent call last):
  File "/home/josh/.venvs/tdd/bin/fab", line 9, in <module>
    load_entry_point('Fabric==1.9.0', 'console_scripts', 'fab')()
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 2431, in load_entry_point
    return ep.load()
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/pkg_resources.py", line 2147, in load
    ['__name__'])
  File "/home/josh/.venvs/tdd/lib/python3.4/site-packages/fabric/main.py", line 12, in <module>
    from operator import isMappingType
ImportError: cannot import name 'isMappingType'

If anyone is willing to help with this it would be much appreciated. I would prefer python3 to python2 and it could help fabric with their errors.
Finally, I have completed chapter 9 with python2 fabric, but it is not as fun. :-) Thanks for anyone willing to help.

--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-goat-book+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jonathan Hartley

unread,
Jul 12, 2014, 1:30:16 PM7/12/14
to obey-the-test...@googlegroups.com
It sounds like what you've done there is installed Fabric to Python3, which installs OK, even though Fabric does not work under Python 3. From the traceback below, Fabric uses the 'operator.isMappingType', which exists in the standard library for Python 2.x, but does not exist for 3.0 (presumably replaced by something elsewhere.)

Caveat: I have no idea what I'm talking about.

    Jonathan Hartley
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Hartley    tar...@tartley.com    http://tartley.com
Made of meat.       +44 7737 062 225       twitter/skype: tartley

Jonathan Hartley

unread,
Jul 12, 2014, 1:31:20 PM7/12/14
to obey-the-test...@googlegroups.com
Maybe replaced by
   isinstance(obj, collections.Mapping)
which is what 2to3 uses.

Jonathan Hartley

unread,
Jul 12, 2014, 1:32:16 PM7/12/14
to obey-the-test...@googlegroups.com
I do like the look of that caveat, I am considering adding it to my email sig.

Jonathan Hartley

unread,
Jul 12, 2014, 1:36:31 PM7/12/14
to obey-the-test...@googlegroups.com
Apparently Fabric was waiting on dependency Paramiko to gain Python3 support, which happened in May, but Fabric is now balking at using the new version of Paramiko, because it drops support for Python2.5.

Gleaned 3rd-hand from this stackoverflow question:
http://stackoverflow.com/questions/18736274/python-3-support-for-fabric

Jonathan Hartley

unread,
Jul 12, 2014, 1:37:33 PM7/12/14
to obey-the-test...@googlegroups.com
and look at this! Here's why 'isMappingType' disappeared:
https://mail.python.org/pipermail/python-dev/2003-November/040307.html

I could entertain myself all night on this.

Harry Percival

unread,
Jul 12, 2014, 1:55:28 PM7/12/14
to Jonathan Hartley, obey-the-test...@googlegroups.com
Nice one Jonathan :)

For anyone interested, there is some progress on getting fabric ported to python 3.  Follow the discussion here:  https://github.com/fabric/fabric/issues/1050

You can try and install one of the attempted python 3 forks and see if it works!

Samantha Zeitlin

unread,
Jun 10, 2015, 5:06:34 PM6/10/15
to obey-the-test...@googlegroups.com
I got the same error. Did you ever end up getting it to work with python3? 

Joshua Wiegand

unread,
Jun 12, 2015, 10:25:42 AM6/12/15
to obey-the-test...@googlegroups.com
Samantha,

I don't remember finding anything of significance and moved on with Python 2 and Fabric. Also, Fabric has not been updated to Python 3 which is disappointing. You can have a look on this website: http://python3wos.appspot.com to see all the packages and their status with regards to the Python version in which they support.

Josh
Reply all
Reply to author
Forward
0 new messages