AttributeError? Installing pipenv on Ubuntu.

AttributeError? Installing pipenv on Ubuntu.

Overcoming challenges with python3 installations on Ubuntu 22

Installing a Python environment on Ubuntu is a dangerous road. You can easily crush your OS since Ubuntu is made using Python. I personally had to install a new OS after mine crushed after installing pipenv on the default python 2.7 that came with Ubuntu 20.

To successfully install pipenv and run pipenv shell on your laptop, follow EXACTLY this procedure.

You'll need to install python3 on your machine since the pipenv will run on python3 instead of the default python, otherwise, you are likely to crush your OS just like I did. You can check if you already have Python3 installed by checking the version using the command:

python3 --version

If you don't have python3 installed yet, you can install it using the commands:
Run sudo apt update to get the latest version of Python3 and update your package list.

Install Python3 by running sudo apt install python3

To verify your installation, you can run python3 --version to see the version of python3 installed.

You can now install pip3 to install additional packages for python 3. (Beware not to install them using pip since it could lead to attribute errors on your machine). To install pip3, use this command:

sudo apt install python3-pip

You can now install packages using pip3 install packageName.

With python3 installed, you can now run pipenv --python (put the version of your python3 here) install. For instance, pipenv --python 3.10.12 install for my version.

You will see something like this:

You can then use pipenv shell to get into the virtual environment and run your code.

HAPPY CODING.