For molecular modelers and scientists leveraging Python scripting in SAMSON, managing Python packages efficiently can be a game-changer. Whether you’re integrating specialized libraries for deep learning, bioinformatics, or advanced simulations, SAMSON’s built-in Python Package Manager simplifies the process, ensuring that automation and extensions remain seamless within your workflows.
The Challenge of Managing Dependencies
In the world of scientific scripting, dependency management often poses challenges: from ensuring compatibility between libraries to installing exact versions required for highly specialized tasks. This can be particularly daunting when working in complex fields like molecular modeling or machine learning, where tools must align precisely for reproducible results. SAMSON tackles this pain point with an integrated solution—the Python Package Manager.
How the Python Package Manager Works
SAMSON includes a Python environment with a package manager that wraps around pip, offering a user-friendly interface to manage dependency libraries. You can access this tool directly through the Python Console by going to Edit > Manage packages…. This opens a Package Manager window where you can:
- View the list of installed Python packages and their versions.
- Install or uninstall Python packages easily.
- Specify specific package versions or additional flags, just as you would in
pip.
For instance, to install a package like foo version 1.2.0, you would input foo==1.2.0. You could even upgrade a package with a command such as foo --upgrade. The setup allows seamless handling of dependencies, empowering you to focus entirely on your modeling tasks.

Installing Local Python Packages
Often, you may need to use custom-built Python packages for your workflows. Within the Package Manager, there’s an option to install local packages directly, provided they include a valid setup.py as part of their structure. Simply provide the path to the package and click the Install button.
Moreover, SAMSON supports the installation of local packages in the editable/develop mode. This mode (pip install -e) dynamically reflects changes in the package’s source code without requiring reinstallation, which is particularly handy for ongoing development or research projects. However, Mac users should note that certain configurations may require reinstalling the package or registering source paths in sys.path after restarting SAMSON.

Removing Python Packages
Uninstalling Python packages is just as simple. Input the name of the package you wish to remove, and click Uninstall. This works for both packages from PyPI and installed custom packages. The process is intuitive and removes any potential friction from dependency management, ensuring a clean scripting environment for your workflows.
A More Manageable Scripting Workflow
With SAMSON’s built-in Python Package Manager, your scripting experience is simpler and better—leaving behind the frustrations of managing dependencies manually. The intuitive interface and powerful features like editable mode for local packages or precise version control with pip flags make it an essential tool for molecular modeling projects.
Want to dive deeper? Visit the official Python scripting documentation to learn more.
*Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.*
