This works for me:

$ git clone https://github.com/fabric/fabric
$ python -c 'import sys; sys.path.append("fabric"); import fabric.version;
print fabric.version.__version__'
1.6.1

I'm not sure how you have your code laid out, but try appending
"static/fabric" to sys.path instead of "static/fabric/fabric".

Regards,
Todd



On Sun, Aug 25, 2013 at 3:17 PM, Andrew Latham <lath...@gmail.com> wrote:

> Jeff, sorry I made some assumptions.
>
> Here is what I am doing
>
> test.py >>>
> #!/usr/bin/env python
>
> import sys
> sys.path.append('static/pycrypto/lib/Crypto')
> sys.path.append('static/paramiko/paramiko')
> sys.path.append('static/fabric/fabric')
>
> import Crypto
> import paramiko
> import fabric
>
> print "Pycrypto Version: " + str(Crypto.version_info)
> print "Paramiko Version: " + str(paramiko.__version__)
> print "Fabric Version: "+ fabric.version
> <<< EOF
>
> here is what I get
> example >>>
> python test.py
> Pycrypto Version: (2, 6, 0, 'final', 0)
> Paramiko Version: 1.9.0
> Traceback (most recent call last):
>   File "test.py", line 15, in <module>
>     print "Fabric Version: "+ fabric.version
> AttributeError: 'module' object has no attribute 'version'
> <<< EOF
>
> I have messed around and decided that it would be better to ask the
> list.  I was able to import the get_version() directly.
>
>
> On Sun, Aug 25, 2013 at 3:02 PM, Jeff Forcier <j...@bitprophet.org> wrote:
> > Not even an actual traceback, or the code that actually involves
> > Fabric itself? Give us something to work with here :(
> >
> > On Sun, Aug 25, 2013 at 6:15 AM, Andrew Latham <lath...@gmail.com>
> wrote:
> >> All....
> >>
> >> I am attempting to load pycrypto, paramiko, and fabric from a local
> >> directory called static.
> >>
> >> I have a project as follows
> >>
> >> project/project.py
> >> project/static/pycrypto
> >> project/static/paramiko
> >> project/static/fabric
> >>
> >> #!/usr/bin/env python
> >> import sys, re, logging
> >> sys.path.append('static/pycrypto/lib/Crypto')
> >> sys.path.append('static/paramiko/paramiko')
> >> import Crypto
> >> import paramiko
> >>
> >> I have pycrypto and paramiko importing correctly and printing their
> >> version as a test.
> >>
> >> When I attempt to do the same with fabric it does not work.  I can
> >> specify a file or function to load and use it. Importing the api.py
> >> fails.  I doubt I am the first to hit this.
> >>
> >>
> >> --
> >> ~ Andrew "lathama" Latham lath...@gmail.com http://lathama.net ~
> >>
> >> _______________________________________________
> >> Fab-user mailing list
> >> Fab-user@nongnu.org
> >> https://lists.nongnu.org/mailman/listinfo/fab-user
> >
> >
> >
> > --
> > Jeff Forcier
> > Unix sysadmin; Python/Ruby engineer
> > http://bitprophet.org
>
>
>
> --
> ~ Andrew "lathama" Latham lath...@gmail.com http://lathama.net ~
>
> _______________________________________________
> Fab-user mailing list
> Fab-user@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Todd DeLuca
Scientific Programmer
http://todddeluca.com
_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to