WebFaction
Community site: login faq

I'm trying to install pycurl for braintree.

I have tried:

pip install braintree

(which installs both pycurl and braintree)

easy_install-2.7 http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz

and

wget http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
tar zxf pycurl-7.19.0.tar.gz
cd pycurl-7.19.0
python2.7 setup.py install

all error out with :

Setup script exited with error: command 'gcc' failed with exit status 1

I thought gcc was already installed on the server?

How can I install braintree and has anyone had success with this?

Thanks!

asked 25 Nov '11, 14:40

teewuane
134
accept rate: 0%


The error isn't really related to gcc. The problem is that our system libcurl is too old for the latest release of pycurl, so gcc is unable to build it.

There are two ways for you to work around this:

  • You can install an older version of pycurl. Version 7.15.5.1 is the newest version that will work with our libcurl. You can install it with the following command:
    easy_install-2.7 pycurl==7.15.5.1
  • You can build a newer version of curl and libcurl from source in your home directory, and then install the newest pycurl on top of that. If you would like to do that, the commands to use are:
    cd ~
    mkdir -p ~/lib/python2.7
    mkdir ~/bin ~/tmp ~/src
    export TEMP=~/tmp
    export PATH=$HOME/bin:$PATH
    cd ~/src
    wget http://curl.haxx.se/download/curl-7.27.0.tar.bz2
    tar xjf curl-7.27.0.tar.bz2
    cd curl-7.27.0
    ./configure --prefix=$HOME
    make
    make install
    easy_install-2.7 pycurl

Finally, you will need to set LD_LIBRARY_PATH to point to the location of your libcurl, eg:

export LD_LIBRARY_PATH=$HOME/lib

Hope that helps!

permanent link

answered 25 Nov '11, 15:06

seanf
12.2k31836
accept rate: 37%

edited 28 Aug '12, 16:03

bmeyer71 ♦♦
1.5k3613

I love webfaction. Thank you so much for that info.

(25 Nov '11, 19:42) teewuane

You're very welcome!

(25 Nov '11, 19:48) seanf

I did everything above, and it's ok. But I have the following error when running Django app on webfaction

libcurl.so.4: cannot open shared object file: No such file or directory

Should I set new lib path somewhere in apache?

(12 Mar '12, 09:21) Dmitry D

Which method did you use to install pycurl?

(12 Mar '12, 11:53) bmeyer71 ♦♦

Second. I build the newer version.

(14 Mar '12, 10:40) Dmitry D

Are you running the 'export LD_LIBRARY_PATH=$HOME/lib' command each time before you start Apache? Is there a file named libcurl.so.4 in $HOME/lib?

(14 Mar '12, 17:49) johns ♦♦

I am on a new server and did the second (build new libcurl) option. I am getting the same error as Dmitry D. I ran the 'export LD_LIBRARY_PATH=$HOME/lib' before starting apache and there is a file in ~/lib/

Help? Again? :)

EDIT: I am using python2.6 this time for what it's worth..

(16 Mar '12, 18:26) teewuane

Where are you seeing the error?

(16 Mar '12, 18:39) seanf

I get a 500 when I hit the specific view on the django project. The entire traceback is emailed to me. But this is I think the important part...

ImportError: libcurl.so.4: cannot open shared object file: No such file or directory

(16 Mar '12, 19:02) teewuane

Try setting LD_LIBRARY_PATH in your apache2/bin/start script. We have an example in our documentation: Depending on Non-Standard Libraries and Headers Causes Errors

Be sure to restart your Apache after making that change.

(16 Mar '12, 19:11) seanf

Cool. I looked at my apache2/bin/start script and the LD_LIBRARY_PATH was already set to another 'lib' path. So what I did was copied the libcurl.so.4 file into the path that it was looking at and now it works. woohoo! Thank you!

(16 Mar '12, 19:39) teewuane

Fixed by changing LD_LIBRARY_PATH in apache2/bin/start (it override your settings by default)

(19 Mar '12, 04:13) Dmitry D
showing 5 of 12 show 7 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×15
×5
×1

question asked: 25 Nov '11, 14:40

question was seen: 6,462 times

last updated: 28 Aug '12, 16:03

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM