Is pip documentation up to date

On windows instructions at 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’

There’s another Slicer forum post with a lot of good information on this topic. See Pip in nightly build not working. Essentially a newer version of pip has changed where main() is located.

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.

1 Like

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

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?

Hi @lassoan,

I meant this method from @patrickcox3 worked:

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

Developer FAQ has been updated with a new entry. See https://www.slicer.org/wiki/Documentation/Nightly/Developers/FAQ#How_to_run_pip_.3F

1 Like