# Pip in nightly build not working

**URL:** <https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325>\
**Category:** Development\
**Tags:** python, pip\
**Created:** [June 28, 2018, 12:41pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325 "2018-06-28T12:41:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)\
**Post date:** [June 28, 2018, 12:41pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/1 "2018-06-28T12:41:57Z")

</div>

Hi,

for another problem I had I was upgrading my Slicer install to the nightly build version. Unfortunately I have problems running the pip installer in the Python Interactive console. I am running the nightly version on a windows system and get the following error:

 ![0-2018-06-26](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/2/a21f47d6f64e488aa422ceefb26e326e9877ab1b.png)

The same command works fine with the release version of Slicer. Is there a new way for installing packages?

Thanks!

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [June 28, 2018, 2:14pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/2 "2018-06-28T14:14:19Z")

</div>

`pip.main` was removed in newer versions of pip. For interactive/one-shot use you can run it from the command line in a Slicer-aware shell (look at `Slicer --launcher-show-set-environment-commands`); for dependency installation as part of a module build, you can shell out from your CMake build.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 30, 2018, 1:26pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/3 "2018-06-30T13:26:35Z")

</div>

> [@ihnorton](#):
>
> `pip.main` was removed in newer versions of pip

That’s unfortunate. It makes more cumbersome to install packages from Slicer modules.

Would it make sense to add Slicer launcher application shortcut for pip? Pip could then launched as: Slicer.exe --pip install…

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [June 30, 2018, 7:43pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/4 "2018-06-30T19:43:25Z")

</div>

> Slicer.exe --pip install…

Or `SlicerPython --pip ...` that way user would have terminal output on windows.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [July 2, 2018, 3:21pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/5 "2018-07-02T15:21:03Z")

</div>

> [@lassoan](#):
>
> Would it make sense to add Slicer launcher application shortcut for pip? Pip could then launched as: Slicer.exe --pip install…

I think `Slicer --launch` already prefers binaries in Slicer’s PATH, so the other option is to document pip as `Slicer --launch pip` (only a few more characters).

---

<div class="post-metadata">

**Author:** ![patrickcox3](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/patrickcox3/32/1463_2.png) [@patrickcox3](https://discourse.slicer.org/u/patrickcox3)\
**Post date:** [July 18, 2018, 9:55pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/6 "2018-07-18T21:55:59Z")

</div>

pip.main can be found in pip.\_internal

I was able to utilize it in my project as shown:

```auto
from pip._internal import main as pipmain
pipmain(['install', 'scipy'])

```

However, using pip within your program [is strongly discouraged](https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program).  
An alternative method, such as spoken to in this thread, would be extremely helpful.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 26, 2018, 1:07pm UTC](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/7 "2018-07-26T13:07:54Z")

</div>

I’ve added a ticket to add `pip` to Slicer install package: [https://issues.slicer.org/view.php?id=4586](https://issues.slicer.org/view.php?id=4586)
