Python 3 support for fabric

Does the technology support ( http://docs.fabfile.org/en/1.7/ ) Python 3. For Python 3, Wall of Superpowers does not yet. If not the best alternative when using Django 1.5 with Python 3.

+51
fabric
Sep 11 '13 at 8:31 on
source share
6 answers

Current answer already made by @ miso.belica

pip install -U "fabric>2.0.0" 

OLD answer (as of 2013)

From the docs:

Please note that all documentation is currently written for Python 2.5 users, but considering possible compatibility with Python 3.x

Or to be more specific:

Python 3.x compatibility

It seems that Python3 support for the factory is a bit confusing and depends on another open source library, paramiko compatible with python3. Currently, the main version supports Python 3.

Perhaps it would be worth playing with this, and then build your copy of the factory on top of this, instead of getting it from pips.

+34
Sep 11 '13 at 19:22
source share

There seems to be a Python3 Fabric port named Fabric3 that supports Python 2.7 and 3.4+ (removed support for Python <2.7). I have been using it for a while as a replacement, and it works for me without any problems.

 pip3 install fabric3 

It seems that there is already official support for Python 3.4+ in Fabric v2 +, and I think this should be preferred, although there may be some incompatible changes . So in an ideal world, no one else should have this problem :)

 pip3 install -U fabric 
+87
Jan 24 '16 at 10:56
source share

You can also create a separate python2.7 virtualenv for fabric only:

 sudo virtualenv --no-site-packages -p /usr/bin/python fabric-env source /var/www/APPNAME/fabric-env/bin/activate sudo /var/www/APPNAME/fabric-env/bin/pip install fabric deactivate 

Then:

 /var/www/APPNAME/fabric-env/bin/fab -f /var/www/APPNAME/fabfile.py FAB_COMMAND 
+17
Jun 19 '14 at 2:39 on
source share

It seems that Fabric is undergoing rewriting and that Fabric 2.0 will be compatible with python 3.x. At least this is what I read between the line of the roadmap below. However, I cannot find the Fabric 2.0 repository or branch, so it’s hard to fully confirm.

http://www.fabfile.org/roadmap.html

+7
Sep 29 '14 at 16:02
source share

You can actually get Fabric to work with Python 3. You can see how I did this in this method .

In the comments above, @rnevius suggests that invoke means the successor to Fabric 1.x, however this is not entirely correct. From invoke docs:

Thus, Invoke was created to focus solely on local and abstract, leaving Fabric 2.x for servers and network commands only.

Thus, it seems that Fabric 2.x will be built on top of invoke . Hopefully Fabric 2.x coming soon, so Python2 could die as quickly as possible.

+2
May 2 '15 at 18:32
source share

To this day, "fabric 2" is available to work with python 3+.

Fabric 3 is an unofficial fork.

To install "fabric 2" from https://pypi.org/project/Fabric/ :

 pip install Fabric 
+2
Aug 02 '18 at 13:27
source share



All Articles