Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- python-pip post-depreciation solution for kali linux
- Python2/3 is a mess
- I only install pip once and using Python3. Then I pip install virtualenv. Then I create and activate a Python2 virtual environment. Once activated, I can pip install python 2 packages as needed without needing to download some kind of Python2 version of pip.
- Here's my notes:
- To verify virtualenv is installed and version is using **Python3**:
- 1. user $ virtualenv --version
- 2. If not:
- user$ sudo apt install virtualenv
- To create a new virtualenv in **Python3**:
- user$ virtualenv ~/.virtualenvs/3/[name of new virtualenv]
- To create a new virtualenv in **Python2**:
- user$ virtualenv -p /usr/bin/python2 ~/.virtualenvs/2/[name of new env]
- To activate an existing virtualenv:
- user$ source ~/.virtualenvs/2/[folder of virtualenv]/bin/activate
- To de-activate the virtualenv in use:
- user$ deactivate
- Running a pip -V after the virtual environment has been activated is an easy check to make sure it will do what you want.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement