0

I am invoking pip commands from within my Python file. I am testing a simple download at the moment.

import pip

directory = 'C:/Users/me/Documents/tests'
package = 'psycopg2'

arguments = ['--only-binary=:all:', '--no-deps', '--platform',
             'manylinux1_x86_64', '--implementation', 'cp',
             '--abi', 'cp27mu', '--dest', directory, package]

def download():
    pip.main(['download'] + arguments)

download()

It successfully downloads it, but I cannot see the file in the directory. If I run it again, it even says:

File was already downloaded c:\users\me\documents\tests\psycopg2-2.7.3.2-cp27-cp27mu-manylinux1_x86_64.whl

Edit

When I try changing the directory, and re-download I get this message:

Using cached psycopg2-2.7.3.2-cp27-cp27mu-manylinux1_x86_64.whl

Sounds like it is saving it in some sort of temp directory instead of the specified one?

turnip
  • 2,246
  • 5
  • 30
  • 58

1 Answers1

0

So I opened the directory this morning, 2 days after I ran the program, to find the file inside. I re-ran the program and it worked just fine...

I guess even computers need the weekend to relax.

turnip
  • 2,246
  • 5
  • 30
  • 58