feeling-free / python-issue

Solving issues for python development
0 stars 0 forks source link

Set python development in ubuntu #1

Open marlon-v-git opened 2 months ago

feeling-free commented 2 months ago
  1. Update System Packages:

    sudo apt update sudo apt upgrade

  2. Install Required Dependencies:

    sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

  3. Install pyenv

    curl https://pyenv.run | bash

  4. Set Up Environment: Add the following lines to your ~/.bashrc or ~/.zshrc file:

    export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"

  5. Apply the Changes:

    pyenv --version

  6. Verify Installation:

    pyenv --version

  7. Install Python Version:

    pyenv install 3.10.5 # Replace 3.10.5 with the desired Python version pyenv global 3.10.5 # Set the installed version as global

marlon-v-git commented 2 months ago

I was stopped at the third step couldn't run "sudo apt install -y python-openssl". So I couldn't install the python package.

feeling-free commented 2 months ago

To solve the problem, "can't run sudo apt install -y python-openssl".

  1. Update Package List:

    sudo apt update

  2. Check Package Availability:

    apt search python-openssl

  3. Install the Correct Package: If python-openssl is not found, it might be due to the transition to Python 3 in newer Ubuntu versions. Instead, install the Python 3 equivalent package:

    sudo apt install python3-openssl

  4. Add Repository (if necessary): If the package is still not found, you might need to add the appropriate repository. For example, add the bionic-security repository:

    sudo nano /etc/apt/sources.list Add the following line: deb http://security.ubuntu.com/ubuntu bionic-security main Save and exit the file, then update the package list: sudo apt update

  5. Try Again:

    sudo apt install python3-openssl