Advertisement
bandors

python-pip post depreciation solution

Feb 7th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. python-pip post-depreciation solution for kali linux
  2.  
  3. Python2/3 is a mess
  4.  
  5. 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.
  6.  
  7.  
  8.  
  9. Here's my notes:
  10.  
  11. To verify virtualenv is installed and version is using **Python3**:
  12. 1. user $ virtualenv --version
  13. 2. If not:
  14.  
  15. user$ sudo apt install virtualenv
  16.  
  17. To create a new virtualenv in **Python3**:
  18.  
  19. user$ virtualenv ~/.virtualenvs/3/[name of new virtualenv]
  20.  
  21. To create a new virtualenv in **Python2**:
  22.  
  23. user$ virtualenv -p /usr/bin/python2 ~/.virtualenvs/2/[name of new env]
  24.  
  25. To activate an existing virtualenv:
  26.  
  27. user$ source ~/.virtualenvs/2/[folder of virtualenv]/bin/activate
  28.  
  29. To de-activate the virtualenv in use:
  30.  
  31. user$ deactivate
  32.  
  33. 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