Advertisement
Justman10000

Manage Python

Mar 5th, 2023 (edited)
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.01 KB | None | 0 0
  1. // To install Python/PIP
  2. !!! You need OpenSSL! To setup see: https://pastebin.com/rZ2jUpFr
  3.  
  4. # Install dependence
  5. apt install make build-essential libaugeas-dev libssl-dev zlib1g-dev libbz2-dev libreadline-dev libgdbm-dev libnss3-dev libffi-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev tk-dev libjs-jquery libjs-underscore libjs-sphinxdoc -y
  6.  
  7. ## When Python was installed
  8. apt purge python* -y
  9. apt autoremove -y
  10.  
  11. # To see all exists versions, go to https://www.python.org/ftp/python
  12. # The version of the generation
  13. version=3.12
  14. # The version of the undergeneration pythons
  15. ugversion=3.12.0
  16. # The undergeneration underversion of python
  17. ugunderVersion=3.12.0b4
  18.  
  19. wget https://www.python.org/ftp/python/$ugversion/Python-$ugunderVersion.tgz --no-check-certificate
  20. gunzip Python-$ugunderVersion.tgz
  21. tar xvf Python-$ugunderVersion.tar
  22. mv Python-$ugunderVersion /usr/local/python
  23. rm -r Python-$ugunderVersion.tar
  24.  
  25. cd /usr/local/python
  26. bash configure --prefix=/usr/local/python --with-openssl=/usr/local/openssl --with-openssl-rpath=auto --with-ssl-default-suites=openssl --enable-optimizations --with-lto --with-computed-gotos --enable-shared --with-ensurepip=install
  27. CFLAGS="-I/usr/local/openssl/include"
  28. LDFLAGS="-L/usr/local/openssl"
  29. C_INCLUDE_PATH=/usr/local/python/Modules/_ctypes/libffi_osx/include
  30. make -j
  31. make altinstall
  32. ln -s /usr/local/python/bin/* /usr/bin
  33. ln -s /usr/bin/pip$version /usr/bin/pip
  34. ln -s /usr/local/python/python /usr/bin
  35. cp lib/libpython* /usr/lib
  36.  
  37. # If pip is not preinstalled
  38. wget https://bootstrap.pypa.io/get-pip.py
  39. python get-pip.py
  40. rm -r get-pip.py
  41.  
  42. # If the error comes, Python.h could not be found (replace "packagename" with the package, what you want do install)
  43. CFLAGS="-I/usr/local/python -I/usr/local/python/Include" pip install packagename
  44.  
  45. // To uninstall Python/PIP
  46. rm -r /usr/local/python
  47. rm -r /usr/bin/2to3*
  48. rm -r /usr/bin/python*
  49. rm -r /usr/bin/pip*
  50. rm -r /usr/bin/idle*
  51. rm -r /usr/bin/py*
  52. rm -r /usr/lib/libpython*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement