Error when pip installing in Slicer's python console

Hi everyone,

I’m trying to pip install packages from the Python console in Slicer using the following commands:

import pip

This works perfectly well on macOS, but on Windows I get the following error (on both 10 and 11, on different machines and with different versions of Slicer: 4.11, 4.13 and 5.2.1):

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
--- Logging error ---

Does anyone else have the same problem?

Thanks in advance!

pip.main() is indeed old and deprecated within pip.

To install python packages using the python console in Slicer you should use pip_install. See the following resources below for examples and more details.


Thanks a lot James, It solved my problem!

1 Like