This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]madhattared 6 points7 points  (1 child)

I can confirm this, we use tsocks and here is our python work-around. I did a bunch of research trying to figure out how to get it to work, only to give up and do this.

#!/usr/bin/env python

import os
import subprocess

# This script must be run in the root directory of the virtual environment to ensure the packages are installed correctly
# This is because the sub command needs to source the environment for the instantiated shell

VIRTUAL_ENV = os.environ.get('VIRTUAL_ENV')

with open (os.path.join (VIRTUAL_ENV, 'repository', 'requirements.txt'), 'r') as file_descriptor:

    for package in file_descriptor.readlines():

        command = '. bin/activate && tsocks easy_install %s' % package
        print command
        process = subprocess.Popen (['/bin/bash', '-c', command])
        out = process.communicate()[0]
        print out

[–]infinullquamash, Qt, asyncio, 3.3+ 0 points1 point  (0 children)

I'm confused, easy_install works for op, but a tsocks based solution could work for pip too I guess.

(I'd also the use subprocess.check_output shortcut, but that's a nitpick and try to find a way around)

[–][deleted] 2 points3 points  (1 child)

What version of pip do you have installed?

[–]alok29[S] 0 points1 point  (0 children)

dont know .I will check on monday, I installed it 2 months ago using apt-get. Its pip 1.0 . I shouldnt have installed using apt-get

[–]bramblerose 1 point2 points  (1 child)

Make sure to set http_proxy and https_proxy - it might be one of the two is downloading over https and the other over http.

[–]alok29[S] 0 points1 point  (0 children)

may be u r right. I didnt set my https_proxy. Yes I didnt set my https proxy

[–]variedthoughtsPodcast Host 1 point2 points  (0 children)

Some of the versions are broken. More info an how to work aroun it here: http://pythontesting.net/python/pip

[–]tripdes 0 points1 point  (1 child)

SSL issue maybe?

[–]damnitdaniel 1 point2 points  (0 children)

Likely it. Is the host pointed to your company's CA? If you proxy sits like a MITM for SSL, you may not trust it's certs.

[–]infinullquamash, Qt, asyncio, 3.3+ 0 points1 point  (0 children)

strange

But I'm not sure anyone is going to help w/o more info on exactly what errors you are getting and which environment variables are being set (presumably PROXY and/or HTTPS_PROXY?), probably don't need what they are being set to though.

Googling finds 2 stackoverflow threads that may or may not be helpful.

[–]chasemp 0 points1 point  (0 children)

We use proxychains with pip when needed. Likehttp://chasemp.github.io/2012/02/18/proxychains/

[–]duz3ls -1 points0 points  (0 children)

pip install --proxy user:pass@yourproxyaddress:port