This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:set-up-python3-environment-and-pip3 [2019/01/21 11:08] seanburns created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | ||
- | # 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][1]. | ||
- | |||
- | ## 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/ | ||
- | |||
- | Create a basic Python3 program: | ||
- | |||
- | ``$echo " | ||
- | |||
- | Run it: | ||
- | |||
- | ``$ python hello.py`` | ||
- | |||
- | Delete it, if you wish: | ||
- | |||
- | ``$ rm hello.py`` | ||
- | |||
- | When you're done working in your environment, | ||
- | |||
- | ``$ 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/ | ||
- | |||
- | Do some Python programming. | ||
- | |||
- | And when done: | ||
- | |||
- | ``$ deactivate`` | ||
- | |||
- | [1]: | ||
- | </ |