| title | Example 1: Installing PyTorch Using the PythonPip Module | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| date | 2023-05-16 | ||||||||||
| status | OK | ||||||||||
| draft | false | ||||||||||
| weight | 871 | ||||||||||
| tags |
|
||||||||||
| menu |
|
The module PythonPip allows you to install additional Python packages to be used in MeVisLab.
{{}} Alternatively, you can use the command-line tool mevislab_pip with the option "--target-mlab-package-path <UserPackagePath>" {{}}
The module either allows to install packages into the global MeVisLab installation directory, or into your defined user package. We will use the user package directory, because then the installed packages remain available in your packages even if you uninstall or update MeVisLab. In addition to that, no administrative rights are necessary if you did install MeVisLab for all users.
{{}}
Installing additional Python packages into MeVisLab by using the PythonPip module requires administrative rights if you do not install into a user package. In addition to that, the installed packages are removed when uninstalling MeVisLab.
{{}}
Add a PythonPip module to your workspace.
Double-click {{< mousebutton "left" >}} the module and inspect the panel.
The panel shows all currently installed Python packages including their version and the MeVisLab package they are saved in. You can see a warning that the target package is set to read-only in the case you are selecting a MeVisLab package. Changing to one of your user packages (see Example 2.1: Package creation for details) makes the warning disappear.
{{}}
Additional information on the PythonPip module can be found in Example 4: Install additional Python packages via PythonPip module.
{{}}
For our tutorials, we need to install torch and torchvision. Enter torch torchvision into the Command textbox and press Install.
{{}} We are using the CPU version of PyTorch for our tutorials as we want them to be as accessible as possible. If you happen to have a large GPU capacity (and CUDA support), you can also use the GPU version. You can install the necessary packages by using the PyTorch documentation available here. {{}}
Continuing with CUDA support: {{< highlight filename="Command" >}}
torch torchvision --index-url https://download.pytorch.org/whl/cu117
{{}}
{{}} If you are behind a proxy server, you may have to set the HTTP_PROXY and HTTPS_PROXY environment variables to the hostname and port of your proxy. These are used by pip when accessing the internet.
Alternatively, you can also add a parameter to pip install command: --proxy https://proxy:port {{}}
After clicking Install, the pip console output opens and you can follow the process of the installation.
After the installation has finished with exit code 0, you should see the new packages in the PythonPip module.
- PyTorch can be installed using the
PythonPipmodule. - There are different versions available (CPU and GPU) depending on the hardware that is used.
- Additional steps have to be taken depending on the version one wishes to install.
- The module displays newly installed packages as soon as the installation was successful.





