Discussion:
[Fab-user] fabric on os x
David Salib
2014-07-30 14:05:10 UTC
Permalink
Hello,

I can't get fabric to work on os x.

I installed it using :

$ pip install fabric

paramiko is at the latest version :

$ pip show paramiko
---
Name: paramiko
Version: 1.14.0
Location: /Library/Python/2.7/site-packages
Requires: pycrypto, ecdsa

yet this happens when I try to run a simple hello world :
-- fabfile.py
def hello():
print ('hello world')
--

$ fab hello
Traceback (most recent call last):
File "/usr/local/bin/fab", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: paramiko>=1.10

I'm pretty new to python so my setup might be erroneous, but I did see
this https://github.com/fabric/fabric/commit/e82aaf4dee89c62b3a629af5d0157a8fe64bedf0
and wondered if it might be related.

Regards,
--
David Salib
Kurt Spindler
2014-07-31 04:58:26 UTC
Permalink
Do a `which fab`, and edit/view that file. Note that the first line of the
script is (for me at least)

#!/usr/bin/python

Now do a `which python`, and I'm willing to guess yours points to somewhere
else (possibly /usr/local/bin/python).

Change that she-bang line to whatever the output of `which python`, and
that should probably fix it. Alternatively, you can change the line to
`#!/usr/bin/env python`.

Cheers,
Kurt
Post by David Salib
Hello,
I can't get fabric to work on os x.
$ pip install fabric
$ pip show paramiko
---
Name: paramiko
Version: 1.14.0
Location: /Library/Python/2.7/site-packages
Requires: pycrypto, ecdsa
-- fabfile.py
print ('hello world')
--
$ fab hello
File "/usr/local/bin/fab", line 5, in <module>
from pkg_resources import load_entry_point
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 2603, in <module>
working_set.require(__requires__)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 666, in require
needed = self.resolve(parse_requirements(requirements))
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: paramiko>=1.10
I'm pretty new to python so my setup might be erroneous, but I did see
this
https://github.com/fabric/fabric/commit/e82aaf4dee89c62b3a629af5d0157a8fe64bedf0
and wondered if it might be related.
Regards,
--
David Salib
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
thierry henrio
2014-07-31 07:56:06 UTC
Permalink
Post by David Salib
Hello,
I can't get fabric to work on os x.
What I do on mine is use http://virtualenv.readthedocs.org/en/latest/

~ $ workon py27
(py27)~ $ pip freeze | grep Fab
Fabric==1.8.3

, Thierry
David Salib
2014-08-01 15:15:17 UTC
Permalink
Kurt:

which returned the same environment as the hashbang :

$ which python
/usr/bin/python
$ head -n 1 `which fab`
#!/usr/bin/python

Thierry : virtualenv makes it work, thanks. Seems like a kludge to me though.

Regards,

D
Post by thierry henrio
Post by David Salib
Hello,
I can't get fabric to work on os x.
What I do on mine is use http://virtualenv.readthedocs.org/en/latest/
~ $ workon py27
(py27)~ $ pip freeze | grep Fab
Fabric==1.8.3
, Thierry
--
David Salib
Spécialiste systèmes / Systems specialist
Fibrenoire - www.fibrenoire.ca
A: 550 ave Beaumont, suite 320, Montreal, Qc, H3N 1V1
T. 514 907-3002 x133

-- Note de confidentialité --
Ce message électronique et toutes pièces jointes contiennent des
informations privilégiées et confidentielles. Si vous n'êtes pas le
destinataire prévu, il est strictement interdit d'utiliser, de copier
ou divulguer les informations ainsi transmises; merci d’en aviser
l'expéditeur et de les supprimer de votre ordinateur.

-- Confidentiality Note --
This email message and any attachments contain privileged and
confidential information. If you are not the intended recipient, your
use, copying or disclosure of this information is prohibited; please
contact the sender and delete the material from your computer.
thierry henrio
2014-08-01 20:27:15 UTC
Permalink
Post by David Salib
$ which python
/usr/bin/python
$ head -n 1 `which fab`
head -1 `which fab` saves 2 chars :)

#!/usr/bin/python
Post by David Salib
Thierry : virtualenv makes it work, thanks. Seems like a kludge to me though.
Main point is that it isolates packages from system and other envs
Then, you can *nuke* one without changing others

And it works as it should

[master]$ workon py27
[master]$ which python
/Users/thenrio/.virtualenvs/py27/bin/python
(py27) [master]$ head -1 $( which fab )
#!/Users/thenrio/.virtualenvs/py27/bin/python

it's just unix path™

Cheers, Thierry
Jeff Forcier
2014-08-01 23:02:13 UTC
Permalink
Hi all,

I dug into this today and spoke to a friend who is deeply embedded in
the packaging world. The tl;dr is that as already noted, using some
newer copy of setuptools (eg via a virtualenv, or upgrading
setuptools) will work around this problem. I've added an FAQ to our
website:

http://www.fabfile.org/faq.html#fabric-installs-but-doesn-t-run

Best,
Jeff
Post by thierry henrio
Post by David Salib
$ which python
/usr/bin/python
$ head -n 1 `which fab`
head -1 `which fab` saves 2 chars :)
Post by David Salib
#!/usr/bin/python
Thierry : virtualenv makes it work, thanks. Seems like a kludge to me though.
Main point is that it isolates packages from system and other envs
Then, you can nuke one without changing others
And it works as it should
[master]$ workon py27
[master]$ which python
/Users/thenrio/.virtualenvs/py27/bin/python
(py27) [master]$ head -1 $( which fab )
#!/Users/thenrio/.virtualenvs/py27/bin/python
it's just unix path™
Cheers, Thierry
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org
Loading...