Run pip in python idle

Hyun-geun Kim picture Hyun-geun Kim · Jan 25, 2016 · Viewed 36.2k times · Source

I am curious about running pip. Everytime I ran pip in command shell in windows like that

c:\python27\script>pip install numpy

But, I wondered if I can run it in python idle.

import pip
pip.install("numpy")

Unfortunately, it is not working.

Answer

fn. picture fn. · Jan 25, 2016

At moment there are no official way to do it, you could use pip.main but you current idle session will not 'see' this installed package.

There been a lot a discussion over how to add a "high level" programmatic API for pip, it's seems promising.