Difference between revisions of "Documentation/Labs/Pip"
From Slicer Wiki
m (Created page with '= Installing Pip = In a nutshell, both distribute and pip will have to be installed. 1. Download distribute: http://python-distribute.org/distribute_setup.py 2. Install dist…') |
|||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | |||
+ | __TOC__ | ||
+ | |||
+ | |||
+ | {{documentation/banner | ||
+ | | text = Starting with [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25957 r25957], Pip is now available in Slicer. It can be launched as ''PythonSlicer -m pip ...''. | ||
+ | | background-color = 8FBC8F }} | ||
+ | |||
= Installing Pip = | = Installing Pip = | ||
− | In a nutshell, both | + | In a nutshell, both setuptools and pip will have to be installed. |
− | 1. Download | + | 1. Download setuptools: https://bootstrap.pypa.io/ez_setup.py |
− | 2. Install | + | 2. Install setuptools: |
− | $ Slicer | + | $ Slicer ez_setup.py |
<pre> | <pre> | ||
− | + | Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.4.zip | |
− | + | Extracting in /tmp/tmpj3retR | |
− | + | Now working in /tmp/tmpj3retR/setuptools-18.4 | |
− | + | Installing Setuptools | |
− | |||
− | Downloading | ||
− | Extracting in /tmp/ | ||
− | Now working in /tmp/ | ||
− | Installing | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
running install | running install | ||
running bdist_egg | running bdist_egg | ||
running egg_info | running egg_info | ||
− | writing | + | writing requirements to setuptools.egg-info/requires.txt |
− | writing top-level names to | + | writing setuptools.egg-info/PKG-INFO |
+ | writing top-level names to setuptools.egg-info/top_level.txt | ||
+ | writing dependency_links to setuptools.egg-info/dependency_links.txt | ||
+ | writing entry points to setuptools.egg-info/entry_points.txt | ||
+ | reading manifest file 'setuptools.egg-info/SOURCES.txt' | ||
+ | reading manifest template 'MANIFEST.in' | ||
+ | writing manifest file 'setuptools.egg-info/SOURCES.txt' | ||
+ | installing library code to build/bdist.linux-x86_64/egg | ||
+ | running install_lib | ||
+ | running build_py | ||
+ | creating build | ||
+ | creating build/lib | ||
+ | copying easy_install.py -> build/lib | ||
+ | creating build/lib/setuptools | ||
+ | copying setuptools/windows_support.py -> build/lib/setuptools | ||
[...] | [...] | ||
− | + | copying setuptools.egg-info/zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO | |
− | + | creating dist | |
− | + | creating 'dist/setuptools-18.4-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it | |
− | + | removing 'build/bdist.linux-x86_64/egg' (and everything under it) | |
− | + | Processing setuptools-18.4-py2.7.egg | |
− | + | Copying setuptools-18.4-py2.7.egg to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/lib/python2.7/site-packages | |
+ | Removing setuptools 5.4.1.dev0 from easy-install.pth file | ||
+ | Adding setuptools 18.4 to easy-install.pth file | ||
+ | Installing easy_install script to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/bin | ||
+ | Installing easy_install-2.7 script to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/bin | ||
+ | |||
+ | Installed /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg | ||
+ | Processing dependencies for setuptools==18.4 | ||
+ | Finished processing dependencies for setuptools==18.4 | ||
</pre> | </pre> | ||
− | 3. Download pip: https:// | + | 3. Download pip: https://bootstrap.pypa.io/get-pip.py |
4. Install pip: | 4. Install pip: | ||
Line 90: | Line 106: | ||
./Slicer --no-main-window --disable-cli-modules --disable-loadable-modules --disable-scripted-loadable-modules --show-python-interactor | ./Slicer --no-main-window --disable-cli-modules --disable-loadable-modules --disable-scripted-loadable-modules --show-python-interactor | ||
− | 2 | + | 2. Try to install a package |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | import pip | |
+ | pip.main(['install', 'pygments']) |
Latest revision as of 06:22, 27 November 2018
Home < Documentation < Labs < PipContents
Starting with r25957, Pip is now available in Slicer. It can be launched as PythonSlicer -m pip .... |
Installing Pip
In a nutshell, both setuptools and pip will have to be installed.
1. Download setuptools: https://bootstrap.pypa.io/ez_setup.py
2. Install setuptools:
$ Slicer ez_setup.py
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.4.zip Extracting in /tmp/tmpj3retR Now working in /tmp/tmpj3retR/setuptools-18.4 Installing Setuptools running install running bdist_egg running egg_info writing requirements to setuptools.egg-info/requires.txt writing setuptools.egg-info/PKG-INFO writing top-level names to setuptools.egg-info/top_level.txt writing dependency_links to setuptools.egg-info/dependency_links.txt writing entry points to setuptools.egg-info/entry_points.txt reading manifest file 'setuptools.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'setuptools.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib copying easy_install.py -> build/lib creating build/lib/setuptools copying setuptools/windows_support.py -> build/lib/setuptools [...] copying setuptools.egg-info/zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO creating dist creating 'dist/setuptools-18.4-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing setuptools-18.4-py2.7.egg Copying setuptools-18.4-py2.7.egg to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/lib/python2.7/site-packages Removing setuptools 5.4.1.dev0 from easy-install.pth file Adding setuptools 18.4 to easy-install.pth file Installing easy_install script to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/bin Installing easy_install-2.7 script to /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/bin Installed /home/matt/bin/Slicer-4.4.0-linux-amd64/lib/Python/lib/python2.7/site-packages/setuptools-18.4-py2.7.egg Processing dependencies for setuptools==18.4 Finished processing dependencies for setuptools==18.4
3. Download pip: https://bootstrap.pypa.io/get-pip.py
4. Install pip:
$ Slicer get-pip.py
Number of registered modules: 1 Number of instantiated modules: 1 Number of loaded modules: 1 Loading Slicer RC file [/home/jchris/.slicerrc.py] Slicer RC file loaded [09/01/2013 20:41:29] Downloading/unpacking pip Running setup.py egg_info for package pip Number of registered modules: 1 Number of instantiated modules: 1 Number of loaded modules: 1 Loading Slicer RC file [/home/jchris/.slicerrc.py] Slicer RC file loaded [09/01/2013 20:41:38] warning: manifest_maker: standard file '' not found warning: no files found matching '*.html' under directory 'docs' warning: no previously-included files matching '*.txt' found under directory 'docs/_build' no previously-included directories found matching 'docs/_build/_sources' Installing collected packages: pip Running setup.py install for pip Number of registered modules: 1 Number of instantiated modules: 1 Number of loaded modules: 1 Loading Slicer RC file [/home/jchris/.slicerrc.py] Slicer RC file loaded [09/01/2013 20:41:41] warning: manifest_maker: standard file '' not found warning: no files found matching '*.html' under directory 'docs' warning: no previously-included files matching '*.txt' found under directory 'docs/_build' no previously-included directories found matching 'docs/_build/_sources' Installing pip script to /home/jchris/Projects/Slicer-AHM-Superbuild-Debug/python-build/bin Installing pip-2.6 script to /home/jchris/Projects/Slicer-AHM-Superbuild-Debug/python-build/bin Successfully installed pip Cleaning up...
For additional information regarding installation of pip. See http://www.pip-installer.org/en/latest/installing.html
Using Pip
1. Within the Slicer python interactor:
./Slicer --no-main-window --disable-cli-modules --disable-loadable-modules --disable-scripted-loadable-modules --show-python-interactor
2. Try to install a package
import pip pip.main(['install', 'pygments'])