Effortless Python Package Management in SAMSON

For molecular modelers, workflows often require integrating external Python packages—be it for advanced simulations, custom data analysis, or machine learning implementations. However, installing and managing these packages can sometimes turn into a daunting task. This is where SAMSON’s integrated Python Package Manager shines, streamlining the process for smooth and efficient scripting.

Why Managing Python Packages in SAMSON Matters

When working on molecular modeling projects, you often rely on specialized Python packages, such as packages for statistical analysis, data visualization, or even bioinformatics. Managing these packages externally, ensuring compatibility, and maintaining versions can eat into your valuable research time. SAMSON simplifies this with its intuitive integrated Python Package Manager, allowing you to manage libraries directly from the Python Console.

How to Access the Python Package Manager

To manage your Python packages seamlessly, navigate to the Python Console in SAMSON by clicking Edit > Manage Packages…. This will open the Python Package Manager interface, where you can view installed packages and their versions. Here’s a visual guide to help you:

Manage packages...

Installing Python Packages Made Simple

Need a new package? Just type its name in the Package Manager and click Install. Whether it’s a package from PyPI or a local Python package, SAMSON makes the installation process seamless. You can specify package versions, for example:

  • foo==1.2.0 to install a specific version of a package.
  • foo>=2.1.0 to set a minimum version requirement.
  • Add standard pip flags, such as foo --upgrade to update a package.

If you’re working on your own Python package and want to make live updates without reinstalling, you can install it in an editable mode (similar to pip install -e). This ensures that changes in the source code are automatically reflected in your installation. Check out the interface for installing Python packages here:

Package Manager: install a Python package

Uninstalling Python Packages

Cleaning up your environment or replacing old libraries? Uninstalling is just as simple. Type the package name in the manager, and click Uninstall. This works for both PyPI packages and local packages.

A Note on Local Python Packages

If you need to use a local Python package, SAMSON supports this as well. Provide the path to the valid package (complete with necessary files like setup.py) and click Install. For packages you actively modify, use the aforementioned editable mode to save time while testing your changes. Here’s an example:

Package Manager: install a local Python package

Note: On some macOS installations, packages installed in editable mode might not load correctly on the next launch. In such cases, install them in non-editable mode or register source directories manually in sys.path.

Final Thoughts

SAMSON’s Python Package Manager is a powerful tool for managing your computational environment efficiently. It integrates directly into the platform, offering you a seamless workflow for integrating external libraries and keeping your Python environment clean and organized. Gone are the days of struggling with package dependencies or external version mismatches.

To dive deeper into managing Python packages in SAMSON, head over to the official documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.

Comments are closed.