Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no module named fabric.api #1743

Closed
kaangoksal opened this issue May 10, 2018 · 11 comments
Closed

no module named fabric.api #1743

kaangoksal opened this issue May 10, 2018 · 11 comments

Comments

@kaangoksal
Copy link

kaangoksal commented May 10, 2018

I have install fabric using pip3 install fabric2,

I can import fabric without any issues however

from fabric.api import *

does not work, it just throws this error, I wonder if the names and the structure of the classes change?

File "main.py", line 1, in
from fabric.api import *
ImportError: No module named 'fabric.api'

I'm working on python3, and also realized that fabric1.x only supports python2.x

@kaangoksal kaangoksal changed the title fabric.api no module named fabric.api May 10, 2018
@rpkilby
Copy link
Contributor

rpkilby commented May 10, 2018

Hi @kaangoksal. Fabric v2 was just released, and the API is significantly different from v1. See: http://docs.fabfile.org/en/latest/upgrading.html

@alorence
Copy link

And http://docs.fabfile.org/en/v2/getting-started.html#a-note-about-imports

@zz22394
Copy link

zz22394 commented Jun 4, 2018

@pushplataranjan
Copy link

pip uninstall fabric
pip install fabric3

@WarlockCyberTutorials
Copy link

@pushplataranjan your tip helped me a lot, it works. Thank's

@alper
Copy link

alper commented May 15, 2020

There is so much outdated documentation and examples out there. 😭

@alper
Copy link

alper commented May 15, 2020

You should use: pipenv install fabric2.

That's an unauthorized fork @pushplataranjan .

See this: http://www.fabfile.org/installing.html#fabric-and-fabric2-vs-fabric3

@nedufural
Copy link

pip uninstall fabric
pip install fabric3

This actually worked for me!

@MuneebKalathil
Copy link

pip3 unsinstall fabric
pip3 install fabric3

This worked for me. CentOS 8

@ploxiln
Copy link

ploxiln commented Jul 30, 2020

some detail, for those who end up here:

fabric3 is a python-3-compatible fork of Fabric-1.x, and fabric3 is no longer maintained, for the past 3 years or so: https://github.com/mathiasertl/fabric/#deprecrecated

This may be totally fine for you, it's probably more important that you use a more recent "paramiko" library, which fabric uses for ssh connections. The "fabric" part is really just about organizing tasks and config, however works for you works.

It just so happens that I continue to maintain a Fabric-1.x fork (https://github.com/ploxiln/fab-classic) which includes the changes from fabric3. (To complicate things a bit, recent versions of fab-classic have a default dependency on my own fork of paramiko (https://github.com/ploxiln/paramiko-ng/). It's possible to switch that back to original paramiko with an environment variable - see the README - but for simple cases it is easier to pip uninstall paramiko fabric fabric3; pip install fab-classic)

@Sameerpy
Copy link

Sameerpy commented Jan 3, 2021

pip install fabric==1.14.0
pip install fabtools

this worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests