|
From: | Brandon Whaley |
Subject: | Re: [Fab-user] ImportError: No module named api while running fabric 2.0.1 python code. |
Date: | Sat, 19 May 2018 10:39:04 -0400 |
Hi,_______________________________________________I am running the below Fabric version and when i execute the below fabric python code i$fab -VFabric 2.0.1Paramiko 2.4.1Invoke 1.0.0$#!/usr/bin/env python
from fabric.api import *
# Set the username
env.user = "root"
# Set the password [NOT RECOMMENDED]
env.password = "Apigee123!"
out_log = open("output.txt", "w")
with open("hosts.txt") as host_file:
host_list = [x.strip() for x in host_file.readlines()]
@hosts(host_list)
def rpm():
with settings(warn_only=True):
version = run("rpm -qa | grep libdb4")
out_log.write("%s: %s" % (env.host, version))$fab rpmTraceback (most recent call last):
File "/usr/local/bin/fab", line 11, in <module>
load_entry_point('fabric==2.0.1', 'console_scripts', 'fab')()
File "/usr/local/Cellar/fabric/2.0.1/libexec/lib/python2.7/site-packages/invoke/program.py", line 321, in run
self.parse_collection()
File "/usr/local/Cellar/fabric/2.0.1/libexec/lib/python2.7/site-packages/invoke/program.py", line 399, in parse_collection
self.load_collection()
File "/usr/local/Cellar/fabric/2.0.1/libexec/lib/python2.7/site-packages/fabric/main.py", line 74, in load_collection
super(Fab, self).load_collection()
File "/usr/local/Cellar/fabric/2.0.1/libexec/lib/python2.7/site-packages/invoke/program.py", line 588, in load_collection
module, parent = loader.load(coll_name)
File "/usr/local/Cellar/fabric/2.0.1/libexec/lib/python2.7/site-packages/invoke/loader.py", line 75, in load
module = imp.load_module(name, fd, path, desc)
File "/Users/kaushalshriyan/singaporetraining/fabfile.py", line 2, in <module>
from fabric.api import *
ImportError: No module named apiAny help will be highly appreciable. Thanks in Advance.Best Regards,Kaushal
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user
[Prev in Thread] | Current Thread | [Next in Thread] |