Efficiently Managing Python Packages in SAMSON

Boost Your Workflow by Managing Python Packages in SAMSON

One of the key challenges for molecular modelers is integrating the right tools and libraries into their workflows. Managing Python packages — ensuring required libraries are installed, up-to-date, or even locally editable — can often be a frustrating and time-consuming task. That’s where the Python Package Manager in SAMSON steps in to simplify the process.

SAMSON’s integrated Python environment makes it easy to install, upgrade, or uninstall Python packages directly from the application. This feature not only saves time but ensures you can customize your workflows to fit your specific needs without leaving the SAMSON platform. Here’s how it works:

Installing Python Packages Simplified

To install a Python package, simply go to Edit > Manage packages… in the Python Console. This will open the Python Package Manager.

Manage packages...

Once the Package Manager is open:

  • Enter the name of the package you want to install.
  • Click Install. SAMSON uses pip, the standard Python package manager, to handle the installation process.

You can even specify specific versions or additional pip flags, such as:

  • package_name==1.2.0: Installs version 1.2.0 of the package.
  • package_name>=2.1.0: Installs the package with a minimum version of 2.1.0.
  • package_name --upgrade: Upgrades the package to the latest version.

Installing Local Python Packages

Need to work with a local Python package? No problem! In the Python Package Manager:

  • Provide the path to your local package. Make sure it’s a valid Python package (i.e., contains a setup.py file).
  • Click Install. You also have the option to install the package in editable/develop mode (similar to pip install -e), which allows your changes to the package’s source code to take effect dynamically without requiring reinstallation.

Package Manager: install a local Python package

Keep in mind that while editable mode is great for active development, it may have specific limitations on some macOS installations. In such cases, consider using the non-editable mode instead.

Uninstalling Python Packages

To remove a package you no longer need, simply type the package name in the Python Package Manager and click Uninstall. This works for packages installed from both PyPI and local sources.

Streamlining Your Workflow

By leveraging SAMSON’s Python Package Manager, you can focus on your key tasks, like molecular modeling or automating workflows. The seamless integration of package management within the platform eliminates many of the hurdles of switching between multiple environments or manually managing dependencies.

Learn more about managing Python packages and other scripting features on the official documentation page: https://documentation.samson-connect.net/users/latest/scripting/.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON today at https://www.samson-connect.net.

Comments are closed.