I have issues installing pycrypto (and thus fabric) with pip

Discussion in 'Python' started by Nicholas Kolatsis, Jan 28, 2013.

  1. I'm not sure this is the right place for this but I'm don't know where elseto put this.

    I want to give fabric a try (as recommended here: http://www.jeffknupp.com/blog/2012/10/24/starting-a-django-14-project-the-right-way/). Installing fabric results in two dependencies (paramiko and pycrypto) being installed aswell. All is dandy until it is time to install pycrypto.

    A bit of searching reveals this in the documentation:

    Package tools

    We strongly recommend using pip to install Fabric as it is newer and generally better than easy_install. However, a combination of bugs in specific versions of Python, pip and PyCrypto can prevent installation of PyCrypto. Specifically:

    Python = 2.5.x
    PyCrypto >= 2.1 (which is required to run Fabric >= 1.3)
    pip < 0.8.1

    When all three criteria are met, you may encounter No such file or directory IOErrors when trying to pip install Fabric or pip install PyCrypto.

    The fix is simply to make sure at least one of the above criteria is not met, by doing the following (in order of preference):

    Upgrade to pip 0.8.1 or above, e.g. by running pip install -U pip.
    Upgrade to Python 2.6 or above.
    Downgrade to Fabric 1.2.x, which does not require PyCrypto >= 2.1, and install PyCrypto 2.0.1 (the oldest version on PyPI which works with Fabric 1.2.)


    (dp130128)cheeky@n5110:~/proj/dp130128$ yolk -l
    Django - 1.4.3 - active
    Python - 2.7.3 - active development (/usr/lib/python2.7/lib-dynload) <--check
    South - 0.7.6 - active
    argparse - 1.2.1 - active development (/usr/lib/python2.7)
    pip - 1.2.1 - active <--check
    setuptools - 0.6c11 - active
    wsgiref - 0.1.2 - active development (/usr/lib/python2.7)
    yolk - 0.4.3 - active

    I've got pip and python covered above but I'm still unable to install fabric as shown below.

    (dp130128)cheeky@n5110:~/proj/dp130128$ pip install fabric
    Downloading/unpacking fabric
    Running setup.py egg_info for package fabric

    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    Downloading/unpacking paramiko>=1.9.0 (from fabric)
    Running setup.py egg_info for package paramiko

    Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko>=1.9.0->fabric)
    Running setup.py egg_info for package pycrypto

    Installing collected packages: fabric, paramiko, pycrypto
    Running setup.py install for fabric

    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    Installing fab script to /home/cheeky/.virtualenvs/dp130128/bin
    Running setup.py install for paramiko

    Running setup.py install for pycrypto
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Hash._MD2' extension
    gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o
    src/MD2.c:31:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/cheeky/.virtualenvs/dp130128/bin/python -c "import setuptools;__file__='/home/cheeky/.virtualenvs/dp130128/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0X00No-record/install-record.txt --single-version-externally-managed --install-headers /home/cheeky/.virtualenvs/dp130128/include/site/python2.7:
    running install

    running build

    running build_py

    running build_ext

    running build_configure

    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

    building 'Crypto.Hash._MD2' extension

    gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o

    src/MD2.c:31:20: fatal error: Python.h: No such file or directory

    compilation terminated.

    error: command 'gcc' failed with exit status 1

    ----------------------------------------
    Command /home/cheeky/.virtualenvs/dp130128/bin/python -c "import setuptools;__file__='/home/cheeky/.virtualenvs/dp130128/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"install --record /tmp/pip-0X00No-record/install-record.txt --single-version-externally-managed --install-headers /home/cheeky/.virtualenvs/dp130128/include/site/python2.7 failed with error code 1 in /home/cheeky/.virtualenvs/dp130128/build/pycrypto
    Storing complete log in /home/cheeky/.pip/pip.log
     
    Nicholas Kolatsis, Jan 28, 2013
    #1
    1. Advertising

  2. Nicholas Kolatsis

    Kwpolska Guest

    On Mon, Jan 28, 2013 at 4:21 PM, Nicholas Kolatsis <> wrote:
    > I'm not sure this is the right place for this


    It is

    > but I'm don't know where else to put this.


    Here. (s/I’m/I/)
    > I want to give fabric a try (as recommended here: http://www.jeffknupp.com/blog/2012/10/24/starting-a-django-14-project-the-right-way/). Installing fabric results in two dependencies (paramiko and pycrypto) being installed as well. All is dandy until it is time to install pycrypto.


    Note that Fabric is useful for much, MUCH more than this.

    > (dp130128)cheeky@n5110:~/proj/dp130128$ pip install fabric


    Off-topic: why is your virtualenv/project name so weird?

    > Downloading/unpacking fabric
    > Running setup.py egg_info for package fabric
    >
    > warning: no previously-included files matching '*' found under directory 'docs/_build'
    > warning: no previously-included files matching '*.pyc' found under directory 'tests'
    > warning: no previously-included files matching '*.pyo' found under directory 'tests'
    > Downloading/unpacking paramiko>=1.9.0 (from fabric)
    > Running setup.py egg_info for package paramiko
    >
    > Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko>=1.9.0->fabric)
    > Running setup.py egg_info for package pycrypto
    >
    > Installing collected packages: fabric, paramiko, pycrypto
    > Running setup.py install for fabric
    >
    > warning: no previously-included files matching '*' found under directory 'docs/_build'
    > warning: no previously-included files matching '*.pyc' found under directory 'tests'
    > warning: no previously-included files matching '*.pyo' found under directory 'tests'
    > Installing fab script to /home/cheeky/.virtualenvs/dp130128/bin
    > Running setup.py install for paramiko
    >


    Seems to be properly installed.

    > Running setup.py install for pycrypto
    > warning: GMP or MPIR library not found; Not building Crypto.PublicKey.._fastmath.
    > building 'Crypto.Hash._MD2' extension
    > gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -csrc/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o
    > src/MD2.c:31:20: fatal error: Python.h: No such file or directory
    > compilation terminated.
    > error: command 'gcc' failed with exit status 1


    Here comes your problem: you do not have the Python header files,
    required to compile the C code used by pycrypto (for speed in certain
    operations, because they are quite resource-intensive). Where can you
    get them? I don’t know, ask your distro. They are usually in a
    package ending with -dev or -devel (depending on your distro; human
    distros do not bother with this and ship them along with the rest of
    the thing…)

    --
    Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
    stop html mail | always bottom-post
    http://asciiribbon.org | http://caliburn.nl/topposting.html
     
    Kwpolska, Jan 28, 2013
    #2
    1. Advertising

  3. Thanks. I've gotten everything working now.

    For anyone else who comes along, 'sudo apt-get install python-dev' did the job.

    >
    > Note that Fabric is useful for much, MUCH more than this.
    >


    I look forward to finding out :)

    >
    > Off-topic: why is your virtualenv/project name so weird?
    >


    Noted. It's the naming pattern that I use for my projects. I should use something better but I'm using this because I usually restart something several times before I'm happy with it. I was reading up on branching with git earlier. It looks like that will put an end to this bad practice.
     
    Nicholas Kolatsis, Jan 29, 2013
    #3
  4. Thanks. I've gotten everything working now.

    For anyone else who comes along, 'sudo apt-get install python-dev' did the job.

    >
    > Note that Fabric is useful for much, MUCH more than this.
    >


    I look forward to finding out :)

    >
    > Off-topic: why is your virtualenv/project name so weird?
    >


    Noted. It's the naming pattern that I use for my projects. I should use something better but I'm using this because I usually restart something several times before I'm happy with it. I was reading up on branching with git earlier. It looks like that will put an end to this bad practice.
     
    Nicholas Kolatsis, Jan 29, 2013
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alvaro E. Gonzalez

    MouseLeave fired on childs controls, This does not have thus to be.

    Alvaro E. Gonzalez, Nov 22, 2006, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    163
    Gabriele G. Ponti
    Nov 22, 2006
  2. Fabric Paul

    Fabric Engine + Python benchmarks

    Fabric Paul, Feb 10, 2012, in forum: Python
    Replies:
    4
    Views:
    470
    Albert W. Hopkins
    Feb 10, 2012
  3. Fabric Paul

    Fabric Engine v1.0 released under AGPL

    Fabric Paul, Mar 20, 2012, in forum: Python
    Replies:
    2
    Views:
    342
    Paul Doyle
    Mar 20, 2012
  4. surf
    Replies:
    5
    Views:
    585
    Dr.Ruud
    Feb 7, 2006
  5. Tim Arnold

    fabric problem with ssh

    Tim Arnold, Aug 24, 2012, in forum: Python
    Replies:
    0
    Views:
    180
    Tim Arnold
    Aug 24, 2012
Loading...

Share This Page