Installing Python Packages

Python Packages

Installing python packages can help import modules seamlessly into Atlas without having to start entirely from scratch. The following video will walk you step by step how to install and uninstall python packages in your workspace.

Command Line Installation

In your Atlas studio workspace, click View and Open Terminal.

Open Terminal

In your terminal window, type the command "pip install [your package name]." After executing that command, we can see that the package was installed successfully.

Install Packages

If you want to uninstall a package, the process is similar: use the command "pip uninstall [your package name]."

Uninstall packages

Package Information

If you want to gather a bit more information about the package, you can do so by using the command "pip show [your package name]." This gives us details like the package version number, author, website, etc.

Package Information and Details

Batch Installation

You can also install Python packages when you run your Python code as a job in a configurable virtual environment. Let's take a look at an example of running a Python file as a job. Navigate to the Python script that you want to run; in the same directory, create a file named requirements.txt. In that file, list the packages that your script requires.

Once you've written your requirements.txt file, it's time to run the script. When you run code as a job, our system automatically searches the directory containing the code for a requirements.txt file and installs the listed packages. After choosing to run the code as a job and choosing the CPU and RAM configuration to use, open the Jobs Dashboard to view its progress.

Once your job has finished running, open the log to verify everything installed as expected. The packages installed while running this job will not be accessible to other jobs; if you run a Python script as a job and it requires installation of packages, be sure that a requirements.txt file exists in the relevant directory with the relevant packages listed.