In this blog post, we will learn how to install Python packages on CloudxLab.
Create the virtual environment for your project. A virtual environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. Login to CloudxLab web console and create a virtual environment for your project.
$ mkdir my_project $ cd my_project $ virtualenv venv
To begin using the virtual environment, it needs to be activated:
$ source venv/bin/activate
The name of the current virtual environment will now appear on the left of the prompt (e.g.
(venv)Your-Computer:your_project$) to let you know that it’s active. From now on, any package that you install using pip will be placed in the
Install packages as usual
$ pip install requests $ pip install flask
If you are done working in the virtual environment you can deactivate it:
Next time when you want to use the same virtual environment, go to your project directory and activate the virtual environment
$ cd my_project $ source venv/bin/activate