Pip in nightly build not working

python
pip

(Andreas Kleinöder) #1

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:

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

Thanks!


Rpy2 pip installation fails
Is pip documentation up to date
(Isaiah Norton) #2

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.


(Andras Lasso) #3

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…


(Jean Christophe Fillion Robin) #4

Slicer.exe --pip install…

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


(Isaiah Norton) #5

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).


Slicer-Python Packages Use and Install
(Patrick) #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.
An alternative method, such as spoken to in this thread, would be extremely helpful.


Is pip documentation up to date
(Andras Lasso) #7

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