Get Started With Intel® Distribution for Python*

ID 768369
Updated 10/31/2024
Version Latest
Public

author-image

By

Intel® Distribution for Python* is a cluster of packages that includes Numba*, NumPy*, and more. These packages are optimized with Intel® oneAPI Data Analytics Library (oneDAL) and Intel® oneAPI Math Kernel Library (oneMKL) to make your Python application more efficient.

The distribution includes the following components:

  • Libraries:
    • numpy
    • python
    • scipy
  • oneMKL interfaces:
    • mkl-fft
    • mkl-random
    • mkl-service
    • mkl-umath
  • GPU components:
    • dpctl
    • dpnp

System Requirements

CPUs:

  • Intel® Core™ processor family
  • Intel® Xeon® processor family

GPUs:

  • Intel® Arc™ graphics
  • Intel® Iris® Xᵉ graphics
  • Intel® Data Center GPU Flex Series
  • Intel® Data Center GPU Max Series
  • Intel® UHD Graphics for 11th generation Intel processors or newer

Operating systems:

  • Linux*
  • Unix family*
  • Windows* 10
  • Windows 11

Supported versions:

  • Python 3.11
  • Python 3.12

Package management:

  • conda*
  • Mamba*
  • PIP*

Compatible with:

  • Jupyter Notebook*
  • Microsoft Visual Studio*
  • PyCharm*
  • Visual Studio Code*

GPU Users

Linux

The driver packages needed on Linux are described in the Data Center GPU Series Driver Installation and Installing Client GPUs pages.

Windows

For GPU development, the latest GPU drivers need to be installed. They can be downloaded at Intel® Arc™ & Iris® Xe Graphics - Windows*.

Installation Options

For product installation visit the Get Intel® Distribution for Python* for all packages and installer types.

You may select the components you wish to install. The full list of components in the Intel® Distribution for Python* is outlined in the What’s Included page.

Conda-based Installer

These instructions present a general overview of the process, followed by a specific example.

General Process for Online Installation

  1. Download the installer file.
  2. Create an installation folder (using any name you wish).
  3. Execute the installer using a console and specify the newly created folder in the installation path.

General Process for Offline Installation

  1. Download the installer file.
  2. Create an installation folder (using any name you wish).
  3. Execute the installer using a console and specify the newly created folder in the installation path.
  4. Transfer the new folder to the machine(s) with no internet connection. 

Example

Linux
  1. Download intelpython3-2025.0.0_0-Linux-x86_64.sh to:
    /home/user/downloads
  2. Run the installer file using the command:
    ./intelpython3-2025.0.0_0-Linux-x86_64.sh -b -p /home/user/python2025
  3. (Optional) For offline, no-internet connectivity installations, move the folder you just created to the target machines.
Windows
  1. Download intelpython3-2025.0.0_0-Windows-x86_64.exe to:
    C:\Users\user\Downloads
  2. Create a new folder, named:
    C:\Users\user\python2025
  3. Run the installer file using the command:
    start /wait file-name.exe /S /RegisterPython=0 /D= C:\Users\user\python2025
  4. (Optional) For offline, no-internet connectivity installations, move the folder you just created to the target machines.

In both examples, the installation folder python2025 is completely redistributable.

Activate the Conda Environment on Your Respective Platform

Linux

The following commands can be used to activate the Intel® Distribution for Python installation:

source $HOME/python2025/bin/activate

Windows

There are two paths to activate your conda environment:

  • Navigate to the Intel Python installation directory, find the Scripts directory, and run .activate in the terminal.
  • Activate from the command line. For example:
    C:\Users\user\python2025\Scripts\.activate

The command prompt should now show (base) at the start of the command prompt.

Verify Installation

To verify your installation success, use the following command:

conda list

(Optional) Deactivating Environment for Offline Installer

To deactivate your Intel® Distribution for Python environment, run the following command until the base environment is deactivated.

conda deactivate

Conda

  1.  Follow the conda Installation Guide to install conda in your environment. If you already have conda installed in your system, update it with: 
    conda update conda
  2. Add the Intel and conda-forge channels to tell conda to choose Intel packages over the default packages (when available):
    conda config --add channels https://software.repos.intel.com/python/conda/
    conda config --add channels conda-forge
  3. Remove the default channel from .condarc (if it exists):
    conda config --remove channels defaults
  4. Install the Intel® Distribution for Python* via conda. We recommend that you create a new environment while installing. To install the python3 environment, run the following command: 
    conda create -n idp intelpython3_full python=3.x

    Note: The x in python=3.x should signify which version of Python you would like to install.

           For example, for Python version 3.12 the full command would be: 

conda create -n idp intelpython3_full python=3.12

           For individual installation commands, refer to the What’s Included section.

  1. Activate the conda environment:
    conda activate idp

Mamba

  1.  Use the conda Installation Guide to install conda and then use the Miniforge installation instructions to get Mamba. Or update it with:
    conda update mamba
  2. Add the Intel and conda-forge channels to tell conda to choose Intel packages over default packages, when available:
    conda config --add channels https://software.repos.intel.com/python/conda/
    conda config --add channels conda-forge
  3.  Remove the default channel from .condarc (if it exists).
    conda config --remove channels defaults
  4. Install Intel® Distribution for Python* via Mamba. We recommend that you create a new environment while installing. To install the core python3 environment, run the following command: 
    mamba create -n idp intelpython3_full python=3.x

           Note: The x in python=3.x should signify which version of Python you would like to install.

  1. Activate the environment:
    mamba activate idp
  2. Verify installation:
    mamba list

PIP

  1.  If you do not have PIP, use the Installation Instructions to install it. After installation, make sure that you can run PIP from the command line.
  2. Create a virtual environment with:
    python3.x -m venv idp

           Note: The x in python=3.x should signify which version of Python you would like to install.

  1. To activate a virtual environment:

            Linux: source idp/bin/activate

            Windows: idp\Scripts\activate

  1. Install Intel® Distribution for Python* components via PIP:
    1. Components that are not available in https://software.repos.intel.com/python/pypi can be found in the PyPI main repository.
    2. Search for individual installation commands in the What’s Included page.
  2. Verify installation:
    pip list

Docker*

  1.  If you do not have Docker installed on your machine, follow the instructions in Install Docker Engine to install it.
  2. Pull the image from DockerHub with:
    docker pull intel/python:latest 
  3. Run a performance sample with:
    git clone https://github.com/intel/ai-containers
    cd ai-containers/python
    docker run --rm -it \
        -v $PWD/tests:/tests \
        intel/python:latest \
        python /tests/perf_sample.py
  4. Verify installation:
    conda list

Example with NumPy

You can see the benefits of using the Intel® Distribution for Python* on your own machine by comparing a simple program’s runtime between both distributions. First, run the sample code below in your new Intel® Distribution for Python* environment, and take note of the total runtime, which should be displayed in the output. 

import numpy as np
import time

start = time.time()

rd = np.random.RandomState(88)
a = rd.randint(1,1000,(1000,1000))
y = rd.randint(1,1000,(1000))
res = np.linalg.solve(a,y)

end = time.time()

print(res)
print('Time Consuming:',end-start)

Once you have taken note of the runtime of this program, switch the environment back to stock Python and run the script again. Compare the runtime in the stock environment to the runtime in the Intel® distribution environment. You should see the benefits provided by the Intel® Distribution for Python* through the decreased runtime.

Code Samples

For more code samples visit the following locations:

Build Your Own Project

No special modifications to your existing Python projects are required to start using them with this toolkit. You can refer to samples on GitHub to learn more about this distribution.

Profiling Python Code

 Additional Resources

Support

If you have further questions or need support on your workload optimization, please submit your queries to the Intel® Distribution for Python* Forum or Intel® Distribution for Python* GitHub, on the Issues or Discussions pages, depending on the type of support required.

Notices and Disclaimers

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available updates. See backup for configuration details. No product or component can be absolutely secure.

Your costs and results may vary.

Intel technologies may require enabled hardware, software or service activation.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.

*Other names and brands may be claimed as the property of others.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.