For molecular modelers diving into scripting and automation, managing Python packages effectively can save significant time and effort. In SAMSON, the integrative molecular design platform, the Python Package Manager offers a simple, powerful way to handle your Python libraries. This post takes a closer look at how to make the most out of this feature and address common pain points associated with package management.
Why Python Package Management Matters
When working on tasks like molecular modeling, simulation, or data visualization, researchers often rely on specialized Python libraries. Installing, updating, or troubleshooting these packages can, however, become a repetitive hurdle, especially for non-specialists. The Python Package Manager in SAMSON provides a streamlined approach to handle these tasks directly within the platform, making it a user-friendly solution for automation and scripting enthusiasts.
Accessing the Python Package Manager
The Python Console in SAMSON is key to managing your Python libraries. Navigate to Edit > Manage packages… to open the Python Package Manager. This will present you with a window where you can see all installed packages and their respective versions, alongside options to install or uninstall new ones.

Whether you are adding a widely used library like numpy or exploring niche packages for deep learning or bioinformatics, everything is managed seamlessly through this interface.
Installing Packages
To install a new Python package, simply provide its name in the manager and click Install. Want a specific version of a package? SAMSON’s package manager supports pip commands! For instance, to install version 1.2.0 of a package named foo, input:
|
1 |
foo==1.2.0 |
Alternatively, if you need a minimum version, you can specify:
|
1 |
foo>=2.1.0 |
The flexibility to include additional pip flags, like --upgrade, ensures you stay in control of your environment.

Local Packages for Custom Development
Developing your Python packages? SAMSON supports installing local packages too. All you need is to provide the path to a valid Python package (that includes, for instance, the setup.py file). What’s more, you can use the editable mode, equivalent to pip install -e, to dynamically reflect any source code changes without reinstallation. This is particularly useful when iterating during development.

Note: Be cautious with the editable mode if you are on macOS, as some installations might not load packages installed this way in the next SAMSON session. In such cases, reinstalling in non-editable mode may be necessary.
Uninstalling Unused Packages
Cleaning up your environment is also straightforward. To uninstall a package, whether from PyPI or local sources, just provide its name and click Uninstall. This intuitive process ensures you can maintain a tidy platform tailored to your projects.
Get Started with Ease
The ability to manage Python libraries directly within SAMSON’s intuitive interface makes it easier to focus on your scientific goals instead of troubleshooting package management. From installing specialized libraries to working with locally developed scripts, everything is at your fingertips.
To learn more, visit the full documentation page here: https://documentation.samson-connect.net/users/latest/scripting/.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
