How to install pipenv in Manjaro using pip.

0
305
(Last Updated On: March 30, 2018)

Introduction

Welcome to this tutorial that will cover how to install pipenv in Manjaro using pip.

What is pipenv?

According to Pipenv:
Pipenv is the officially recommended Python packaging tool from Python.org.
According to the site, the tool that aims and works pretty smart to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the huge base of Python community .

So what does pipenv do differently?

The tool does add a lot of convenience to the developer in that it automatically creates and manages a virtualenv for your projects, as well as adds and/or removes packages from your Pipfile as you install or uninstall packages. It also generates the ever-important Pipfile.lock, which is used to produce deterministic builds. The previous tedious means of creating a virtual environment in python is alleviated by this beautiful packaging tool.
Pipenv is primarily meant to provide users and developers of applications with an easy method to setup a working environment

First install pip

# sudo pacman -S pip

After pip has been installed, the next step is to install pipenv python packaging tool.

# sudo pip install --user pipenv

The above command will install pipenv to the current user level other than installing it system-wide.
Confirm if pipenv is installed by using it to install django or any other package. If there is an error about its availability, then do not panic. At this point, you will have to add the user binary directory to PATH environment variable. To view your user base, just invoke the following command:

# python -m site --user-base

You will see something like:
/home/penchant/.local
Where /home/penchant is your home directory and will look different in your shell.
After you have your user base, the next step is to ad it to your PATH environment variable. This is accomplished by following the following steps:
Make sure $HOME reflects your home directory path by typing the following at your terminal

# echo $HOME

Now launch the ~/.profile file using your favorite editor such as vim or nano

# vim ~/.profile

And add the following line at the bottom of the file:

# export PATH="$HOME/.local/bin:$PATH"

Save the file and source it by doing:

# source ~/.profile

And there you have pipenv
Congratulations.