Advertisement
flycat

Python examples

Sep 24th, 2020 (edited)
1,370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.89 KB | None | 0 0
  1. # Install from source:
  2. apt install libssl-dev libffi-dev
  3. wget https://www.python.org/ftp/python/3.7.10/Python-3.7.10.tgz
  4. tar xzf Python-3.7.10.tgz
  5. cd Python-3.7.10
  6. ./configure --enable-optimizations
  7. make -j2
  8. make altinstall
  9. python3.7 -V
  10.  
  11. # Install installer
  12. apt install python-pip
  13. apt install python3-pip
  14. # OR
  15. wget https://bootstrap.pypa.io/get-pip.py
  16. python get-pip.py
  17.  
  18. # Install package
  19. pip install <package>
  20.  
  21. # View what installed
  22. pip list
  23. # View package info (dependensys)
  24. pip show <package>
  25. pip install pipdeptree
  26. pipdeptree
  27.  
  28. # View updates
  29. pip list --outdated
  30. # or
  31. pip install pip-check
  32. pip-check
  33.  
  34. # Update:
  35. pip install --upgrade <package>
  36.  
  37. # Virtual environment creation:
  38. python3 -m venv  ~/.local/pyvenv
  39. # View virtual env:
  40. echo $VIRTUAL_ENV
  41.  
  42. # Venv upgrade:
  43. python3 -m venv --upgrade ENV_DIR
  44.  
  45. # Use venv from script:
  46. #!/opt/mail-in/bin/.env/bin/python3.11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement