Hello I have trouble understanding packages manager such as apt
pip
pip3
I am trying to automate shell command with the use of fabric3
library
I am following a book which tells me to write the following shell command pip install fabric3
My fabfile.py
contains f-strings which are working on python3 only
when I do pip list
I see Fabric3 (1.14.post1)
so I am assuming that the package is successfully installed, yet when I run my fab
, I get fab not found, and command line is telling me to sudo apt install fabric
But doing so is useless, because fabric
is working only with python2.7
Basically I have thought of two possible solutions to my problem :
1- Trying to make the fab
command to use python3.6
instead of python2.7
? But I don't know how to do that ...
2- Deleting Fabric, and keeping Fabric3, but for some reason, I get this 'fab' not found
and I don't understand why
I have read the documentation but It is really obscur, I find no answer to my issue
Any help will be greatly appreciated, Thanks
Update1:
So when I run pip list
asn1crypto (0.24.0)
attrs (17.4.0)
Automat (0.6.0)
bcrypt (3.1.7)
blinker (1.4)
certifi (2018.1.18)
cffi (1.13.2)
chardet (3.0.4)
click (6.7)
cloud-init (19.2)
colorama (0.3.7)
command-not-found (0.3)
configobj (5.0.6)
constantly (15.1.0)
cryptography (2.8)
distro-info (0.18ubuntu0.18.04.1)
Fabric3 (1.14.post1)
httplib2 (0.9.2)
hyperlink (17.3.1)
idna (2.6)
incremental (16.10.1)
Jinja2 (2.10)
jsonpatch (1.16)
jsonpointer (1.10)
jsonschema (2.6.0)
keyring (10.6.0)
keyrings.alt (3.0)
language-selector (0.1)
MarkupSafe (1.0)
netifaces (0.10.4)
oauthlib (2.0.6)
PAM (0.4.2)
paramiko (2.7.1)
pip (9.0.1)
pyasn1 (0.4.2)
pyasn1-modules (0.2.1)
pycparser (2.19)
pycrypto (2.6.1)
pygobject (3.26.1)
PyJWT (1.5.3)
PyNaCl (1.3.0)
pyOpenSSL (17.5.0)
pyserial (3.4)
python-apt (1.6.4)
python-debian (0.1.32)
pyxdg (0.25)
PyYAML (3.12)
requests (2.18.4)
requests-unixsocket (0.1.5)
SecretStorage (2.3.1)
service-identity (16.0.0)
setuptools (39.0.1)
six (1.13.0)
ssh-import-id (5.7)
systemd-python (234)
Twisted (17.9.0)
ufw (0.36)
unattended-upgrades (0.1)
urllib3 (1.22)
wheel (0.30.0)
zope.interface (4.3.2)
Fabric3 is correctly installed
Then, I run this command to deploy my code on server :
fab deploy:host=xxx@yyy
where xxx
is username
and yyy
is domain name
I get the following error : Command 'fab' not found, but can be installed with: sudo apt install fabric
NOTE: I tried this command update-alternatives --install /usr/bin/python python /usr/bin/python3.6 10
found on this topic Unable to set default python version to python3 in ubuntu
and which python
stills points to /usr/bin/python
I have found that I have /usr/bin/python3.6
Do you think if I manage to have the which python
pointing to /usr/bin/python3.6
my issue will be solved?