# Is pip documentation up to date

**URL:** <https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882>\
**Category:** Support\
**Created:** [November 27, 2018, 4:33am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882 "2018-11-27T04:33:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [November 27, 2018, 4:33am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/1 "2018-11-27T04:33:54Z")

</div>

On windows instructions at [https://www.slicer.org/wiki/Documentation/Labs/Pip](https://www.slicer.org/wiki/Documentation/Labs/Pip)  
work for 4.8.1, but not for the latest stable 4.10.0. I get this

\>\>\> import pip

\>\>\> pip.main([‘install’, ‘pygments’])

Traceback (most recent call last):

File "\<console\>", line 1, in \<module\>

AttributeError: ‘module’ object has no attribute ‘main’

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [November 27, 2018, 5:18am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/2 "2018-11-27T05:18:30Z")

</div>

There’s another Slicer forum post with a lot of good information on this topic. See [Pip in nightly build not working](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325). Essentially a newer version of pip has changed where `main()` is located.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [November 27, 2018, 5:31am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/3 "2018-11-27T05:31:13Z")

</div>

That being said, that Pip wiki page should probably be updated with the information found in that forum thread. I currently don’t have access to edit the wiki.

However that Pip wiki page is also under the “Labs” category which I don’t believe has all of its subpages up-to-date. I think it is more a dumping ground of notes by developers when trying to plan a project. I think that’s why keeping those pages up-to-date isn’t a priority since users won’t need to read them as part of the actual primary Slicer documentation.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [November 27, 2018, 5:56am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/4 "2018-11-27T05:56:42Z")

</div>

Thanks @jamesobutler. Provided example in the thread worked for me.

---

<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:** [November 27, 2018, 6:26am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/5 "2018-11-27T06:26:23Z")

</div>

Which example worked?

I think pip main is not supposed to be accessed manually (as when you launch a Python interpreter, some packages may not be possible to update because they are already loaded).

Instead you can run pip as `PythonSlicer -m pip install something`.  
@muratmaga can you confirm that this works?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [November 27, 2018, 5:09pm UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/6 "2018-11-27T17:09:22Z")

</div>

Hi @lassoan,

I meant this method from @patrickcox3 worked:

> [@Pip in nightly build not working](https://discourse.slicer.org/t/pip-in-nightly-build-not-working/3325/6):
>
> pip.main can be found in pip.\_internal I was able to utilize it in my project as shown: 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.

Scipy installed successfully as far as I can tell. It didn’t work with Rpy2. I will try your suggestion in the other thread.

---

<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:** [November 28, 2018, 7:00am UTC](https://discourse.slicer.org/t/is-pip-documentation-up-to-date/4882/7 "2018-11-28T07:00:51Z")

</div>

Developer FAQ has been updated with a new entry. See [https://www.slicer.org/wiki/Documentation/Nightly/Developers/FAQ#How\_to\_run\_pip\_.3F](https://www.slicer.org/wiki/Documentation/Nightly/Developers/FAQ#How_to_run_pip_.3F)
