Advertisement
Justman10000

Manage Python

Mar 5th, 2023 (edited)
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.05 KB | None | 0 0
  1. // To install Python/PIP
  2. !!! You need OpenSSL! To setup see: https://pastebin.com/rZ2jUpFr
  3.  
  4. # Via APT (igore the whole content below this)
  5. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/python3.13_3.13.0~b2-1_amd64.deb
  6. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/python3.13-minimal_3.13.0~b2-1_amd64.deb
  7. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/python3.13-venv_3.13.0~b2-1_amd64.deb
  8. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/python3.13-dev_3.13.0~b2-1_amd64.deb
  9. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/libpython3.13_3.13.0~b2-1_amd64.deb
  10. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/libpython3.13-stdlib_3.13.0~b2-1_amd64.deb
  11. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/libpython3.13-minimal_3.13.0~b2-1_amd64.deb
  12. wget http://ftp.de.debian.org/debian/pool/main/s/setuptools/python3-setuptools-whl_68.1.2-2_all.deb
  13. wget http://ftp.de.debian.org/debian/pool/main/p/python-pip/python3-pip-whl_24.1+dfsg-1_all.deb
  14. wget http://ftp.de.debian.org/debian/pool/main/p/python3.13/libpython3.13-dev_3.13.0~b2-1_amd64.deb
  15. dpk -i *.deb
  16. rm *.deb
  17.  
  18. # Install dependence
  19. 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
  20.  
  21. ## When Python was installed
  22. apt purge python* -y
  23. apt autoremove -y
  24.  
  25. # To see all exists versions, go to https://www.python.org/ftp/python
  26. # The version of the generation
  27. version=3.12
  28. # The version of the undergeneration pythons
  29. ugversion=3.12.0
  30. # The undergeneration underversion of python
  31. ugunderVersion=3.12.0b4
  32.  
  33. wget https://www.python.org/ftp/python/$ugversion/Python-$ugunderVersion.tgz --no-check-certificate
  34. gunzip Python-$ugunderVersion.tgz
  35. tar xvf Python-$ugunderVersion.tar
  36. mv Python-$ugunderVersion /usr/local/python
  37. rm -r Python-$ugunderVersion.tar
  38.  
  39. cd /usr/local/python
  40. 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
  41. CFLAGS="-I/usr/local/openssl/include"
  42. LDFLAGS="-L/usr/local/openssl"
  43. C_INCLUDE_PATH=/usr/local/python/Modules/_ctypes/libffi_osx/include
  44. make -j
  45. make altinstall
  46. ln -s /usr/local/python/bin/* /usr/bin
  47. ln -s /usr/bin/pip$version /usr/bin/pip
  48. ln -s /usr/local/python/python /usr/bin
  49. cp lib/libpython* /usr/lib
  50.  
  51. # If pip is not preinstalled
  52. wget https://bootstrap.pypa.io/get-pip.py
  53. python get-pip.py
  54. rm -r get-pip.py
  55.  
  56. # If the error comes, Python.h could not be found (replace "packagename" with the package, what you want do install)
  57. CFLAGS="-I/usr/local/python -I/usr/local/python/Include" pip install packagename
  58.  
  59. // To uninstall Python/PIP
  60. rm -r /usr/local/python
  61. rm -r /usr/bin/2to3*
  62. rm -r /usr/bin/python*
  63. rm -r /usr/bin/pip*
  64. rm -r /usr/bin/idle*
  65. rm -r /usr/bin/py*
  66. rm -r /usr/lib/libpython*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement