Langsung ke konten utama

Installing pip for Python

Installing pip for Python 3

Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip (pip3) for Python 3:

Start by updating the package list using the following command:

$ sudo apt update

Use the following command to install pip for Python 3:

$sudo apt install python3-pip

The command above will also install all the dependencies required for building Python modules.

Once the installation is complete, verify the installation by checking the pip version:

$ pip3 --version

The version number may vary, but it will look something like this:

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

Installing pip for Python 2

Python 2 is not installed by default in Ubuntu 18.04. To install Python 2 and pip for Python 2, complete the following steps:

Update the package index by running the following command:

$ sudo apt update

Install pip for Python 2 with:

$ sudo apt install python-pip

The command above will install Python2, Pip and all the dependencies required for building Python modules.

Verify the installation by printing the pip version number:

$ pip --version

The version number may vary, but it will look something like this:

pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

How to Use Pip
When installing python modules globally it is highly recommended to install distribution provided python modules using the apt package manager because they are tested to work properly on Ubuntu systems.

You should install Python modules globally using pip only if there is no package available through the package manager.


In most cases, you should use pip within a virtual environment only. Python Virtual Environments allows you to install Python modules in an isolated location for a specific project, rather than being installed globally. This way you do not have to worry about affecting other Python projects.

In this section, we show you a few useful basic pip commands. With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI.

To view the list of all pip commands and options, type:

$ pip3 --help

Komentar

Postingan populer dari blog ini

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount): SD card USB drives CD drives (CDFS) Network drives UNC paths Local storage / drives Drives formatted as FAT, ExFAT or NTFS can be mounted in WSL. For this example, we assume the drive shows in Windows as F:\ If Windows changes the USB drive letter on a subsequent session, you need to repeat this process. The commands are typed into the Windows Subsystem for Linux Terminal. Create a mount location in WSL: $ sudo mkdir /mnt/f Mount the drive in WSL: $ sudo mount -t drvfs f: /mnt/f After this one-time setup, one can create and manipulate files from both Windows and WSL on the same drive. network storage Here we assume: networked storage is already showing in Windows under \\server\share we want to access this network storage from WSL as /mnt/share Create a mount location in WSL: $ sudo mkdir /mnt/share Mount the network share in WSL: $ sudo mount -t drvfs '\\server\share' /mnt/share

FMW 12.2.1.3.0: "ONS configuration failed" or "oracle.ons.NoServersAvailable: Subscription time out"

FMW 12.2.1.3.0: "ONS configuration failed" or "oracle.ons.NoServersAvailable: Subscription time out" Solving To implement the workaround in the Configuration Wizard(config.sh) set the following environment variable before launching config.sh. $ export CONFIG_JVM_ARGS=-Doracle.jdbc.fanEnabled=false

ERROR ORACLE DB: The version 12.2.0.1.0 of the database that you are using is not a supported version

ERROR ORACLE DB: The version 12.2.0.1.0 of the database that you are using is not a supported version or The specified user may not have sufficient privileges to perform this operation. User should have sysdba or dba privileges. Solution SQL> alter system set db_32k_cache_size = 512M scope=both;