-2

I'm trying to install pycurl. I downloaded and decompressed pycurl-7.10.5.tar.gz but I don't know what to do with the output. Could someone help me with the install. I have python 3.5 and 3.3 installed as well as the Eclipse IDE with the PyDev extension. I'd rather stay away from unix-like command line commands if possible and install from the native OSX interface. Something always goes wrong whenever I try things in the terminal. For example, the first line of the INSTALL file tells me to tar -zxvf pycurl-$VER.tar.gz the response I get is: tar: Error opening archive: Failed to open 'pycurl-.tar.gz' Thank you, Joe

JoeM
  • 29
  • 1
  • 10

2 Answers2

0

The only real answer is to use a command line, one that you can run the python that you need to install curl to, i.e.:

pip install ./pycurl-7.10.5.tar.gz 

if this fails try:

sudo pip install ./pycurl-7.10.5.tar.gz 

in the directory that you downloaded the tar.gz to. BTW the terminal is the native interface. You will need to do this twice - once for each python.

You could always write a small python script to take the name of a package and do:

subprocess.call(['pip', 'install', name_of_package])

again you may need to run this with elevated privileges. (I don't have a Mac to try it out on). The good news is that if you are connected to the net at the time then just pip install pycurl should download the latest compatible version and install it all in one operation.

Missing pip?

If pip is missing then you can follow the installing pip instructions which consist of: To install pip, securely download get-pip.py.

Then run the following (which may require administrator access):

python get-pip.py

If setuptools is not already installed, get-pip.py will install setuptools for you.

To upgrade an existing setuptools, run pip install -U setuptools.

Install behind a proxy:

python get-pip.py --proxy="[user:password@]proxy.server:port"

Upgrade pip

On Linux or OS X:

pip install -U pip

On Windows [5]:

python -m pip install -U pip
Steve Barnes
  • 27,618
  • 6
  • 63
  • 73
  • Yes, I can run python. That, I had installed a while back. However, I don't have pip, and I don't have apt-get. (I found out when I tried to use apt-get to get pip.) Either, the OSX doesn't come with it, or I deleted it accidentally a while back. In either case I'm having trouble finding it for OSX. All the info out there points me to some other install tools. Thanks – JoeM Sep 21 '15 at 23:13
  • @JoeM - Added how to add a pip if it is missing. – Steve Barnes Sep 22 '15 at 04:31
  • Thank you Steve, Using your advice I was able to download Pip. I now have it successfully installed. Only question I have is that I have 3 version of python: 2.7, 3.3, and 3.5. How do I know which version I ran the "python get-pip.py" command against? I believe it was 2.7 because that is the version I get when I run python from the command line. I actually only want the latest version, 3.5, that's what I see in the Eclipse IDE. How can I "point" to 3.5? Better yet, can I get rid of 2.7 and 3.3 to avoid confusion? – JoeM Sep 23 '15 at 13:26
  • For the version, in the same context run `python --version` the rest is a) a separate question, b) OS-X specific & c) Can cause problems if the OS relies on a version that you get rid of, so can't be much help here - sorry! – Steve Barnes Sep 23 '15 at 15:40
  • Hi, the reason I asked about versions is the long way around to inquire why my make command failed. I get ... 'Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-jK46FQ-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8rDnAD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-jK46FQ-build ' .... There was a lot more on the console, but this is the last error line. – JoeM Sep 27 '15 at 13:28
0

On OSX, you need to set the arch flag in the env. Try this, it should build:

sudo env ARCHFLAGS="-arch x86_64" pip3.5 install ./pycurl-7.43.0.tar.gz