Exception using pip install

I am new to python and am trying to install a django project on a server instance that I have installed from Ubuntu 14.04 on DigitalOcean. When I run the command sudo pip install requirements.txt

, it seems to set all the requirements, but then throws the following exception:

running build_ext

building '_cffi_backend' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/c

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o

c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory

 #include <ffi.h>

                 ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-k7f7bu-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cffi
Storing debug log for failure in /home/myname/.pip/pip.log

      

I checked and my dev machine and server both have python version installed (2.7.6)

Update After running the installation suggested below I'L'I, I made some progress but got another exception:

running build_ext

building 'gnureadline' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/Modules

creating build/temp.linux-x86_64-2.7/Modules/2.x

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/include/python2.7 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.7/Modules/2.x/readline.o

In file included from Modules/2.x/readline.c:31:0:

./readline/readline.h:385:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]

 extern int rl_message ();

 ^

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-x86_64-2.7/gnureadline.so

/usr/bin/ld: cannot find -lncurses

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/gnureadline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-B2p3jW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/gnureadline
Storing debug log for failure in /home/juan/.pip/pip.log

      

+3


source to share


1 answer


You don't seem to have libffi-dev

:

sudo apt-get install libffi-dev

      

Should install package with missing header.



If this is a new server, you can also install some of the more common developer packages right away:

sudo apt-get install libffi-dev libssl-dev libxml2-dev libxslt1-dev libncurses5-sdev

      

+6


source







All Articles