Learn Python 2: Virtual Environments on Ubuntu Linux & macOS

preview_player
Показать описание
Learn how to create virtual environments on Ubuntu Linux and macOS to keep your code well organized. Again, we cover manually creating venv, installing packages with pip and then virtualenvwrapper to help once you get serious about your Python coding.

Timestamps:
00:00 Intro
01:10 Ubuntu linux Python3 setup
03:10 sudo apt install python3-pip python3-venv
03:45 Manually create & activate a virtual environment on linux
05:12 virtualenvwrapper on Ubuntu
10:44 macOS - create virtual environments manually
11:50 virtualenvwrapper install for macOS
14:02 Closing words

My file:

# ubuntu
sudo apt install python3-pip python3-venv
pip3 install virtualenvwrapper
sudo vi ~/.bashrc
###
export PATH="/home/joe/.local/bin:$PATH"
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/code
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.7
###
source ~/.bashrc

# macOS

###
export WORKON_HOME=$HOME/code/.virtualenvs
export PROJECT_HOME=$HOME/code
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
###
source ~/.bash_profile

Twitter:

Free Python book:

#python #coding #linux #macOS
Рекомендации по теме
Комментарии
Автор

i followed your video and was able to get tot to work. Yet i can not find were the virtual environments are placed so i can delete the ones i added. Nor can i find the one i want to keep. Can you share with me were they are placed. I created a directory called Firmware but there is nothing in it. thanks

scottclifford-cliffordmfg
Автор

Question: If I have an old laptop with Intel n2840 cpu, 8gb ddr3 ram and a 120gb ssd running Fedora linux.
Is it too slow to be used for learning Python?

larrylarry
Автор

If using oh my zsh, do you just edit .zshrc the same as .bashrc ? Thanks!

snakesnarroz
Автор

Virtualenvs for macOS and linux. If you're wondering why I've been tackling these first, all (should) be revealed in the next few videos.

null_zero
Автор

When I try to install virtualenvwrapper on MacOS, it gives me the following:

Requirement already satisfied: virtualenvwrapper in (4.8.4)
Requirement already satisfied: virtualenv-clone in (from virtualenvwrapper) (0.5.6)
Requirement already satisfied: stevedore in (from virtualenvwrapper) (3.3.0)
Requirement already satisfied: virtualenv in (from virtualenvwrapper) (20.6.0)
Requirement already satisfied: pbr!=2.1.0, >=2.0.0 in (from stevedore->virtualenvwrapper) (5.6.0)
Requirement already satisfied: in (from (1.1.0)
Requirement already satisfied: filelock<4, >=3.0.0 in (from (3.0.12)
Requirement already satisfied: distlib<1, >=0.3.1 in (from (0.3.2)
Requirement already satisfied: platformdirs<3, >=2 in (from (2.2.0)
Requirement already satisfied: six<2, >=1.9.0 in (from (1.16.0)

I added the script in .bash_profile but,
When I try "source ~/.bash_profile "
it says,

no such file or directory:

Is it conflicting with my conda installation? What do I do from here?

nathanfernandes