User Tools

Site Tools


linux:set-up-python3-environment-and-pip3

Set up Python3 Environment and Pip3

Date: Thu Sep 13 10:07:00 EDT 2018

Brief tutorial on using Python3 and Pip3 on the server. This is based on the more extensive tutorial available on Digital Ocean.

To install and set up

After logging in, assuming you're in your home directory:

Make your environment directory:

$ mkdir environments

Change to it:

$ cd environments/

Create the environment:

$ python3 -m venv my_env

Check it out:

$ ls my_env/

Activate it:

$ source my_env/bin/activate

Create a basic Python3 program:

$echo "print('Hello world')" >> hello.py

Run it:

$ python hello.py

Delete it, if you wish:

$ rm hello.py

When you're done working in your environment, deactivate it:

$ deactivate

Post Setup

After you've set things up, you just need to activate, do some Python, and then deactivate it when you want to do some Python programming:

$ source my_env/bin/activate

Do some Python programming.

And when done:

$ deactivate

linux/set-up-python3-environment-and-pip3.txt · Last modified: 2019/01/21 11:08 by seanburns