Get Started With Intel® Distribution for Python*

ID 768369
Updated 11/7/2023
Version Latest
Public

author-image

By

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

Supported Installation Options

Install via Standalone Installer

  1. To download Intel Distribution for Python*, visit here and choose the installation method of your choice. Find detailed information about the AI® Tools here

  1. Run the following commands to install on respective platform:

    • # Linux installation (Interactive) 
      
      bash ~/intelpython3.sh 
      
       
      
      # Linux installation (CLI) 
      
      bash ~/intelpython3.sh -b -u -p ~/intelpython3 
      
       
      
      # Windows installation (Interactive) 
      
      intelpython3.exe 
      
       
      
      # Windows installation (CLI) 
      
      start /wait intelpython3.exe /S /RegisterPython=0 /D=%LOCALAPPDATA%\intelpython3 
  2. Activate the conda environment. 

    • Linux*: 

      • If you have root access to your oneAPI installation path or if you use the Intel® Developer Cloud: 

        Intel Python environment will be activated by default. However, if you have activated another environment, you can return with the following command: 

      • source activate base 

         

    • Windows*:

      • C:\Program Files(x86)\Intel\oneAPI\intelpython\python3.x\Scripts\activate 

         

Install via Anaconda:

  1. Follow Conda Installation Guide to install Conda in your environment. If you already have conda installed in your system, please update your conda: 
    conda update conda
  2. Add Intel channel
    Tell conda to choose Intel packages over default packages, when available.
    conda config --add channels intel
  3. Install Intel Distribution for Python via conda. We recommend that you create a new environment while installing. To install the core python3 environment, do: 
    conda create -n idp intelpython3_core python=3.x
    Please note that “x” in “python=3.x” should signify which version of Python* you would like to install. For example, for Python* version 3.9: conda create -n idp intelpython3_core python=3.9
  4. Acitvate conda environment, then follow the usual steps for activating the environment: 
    conda activate idp

Sanity Check

After the activation of the environment, type python in the command line to find the Python* distribution info.

  • Linux* & Windows*: python
    The distribution info should include Intel Corporation:
  • Linux: 
    Python 3.9.16 (default, Jun 4 2021, 06:52:02)
    [GCC 9.3.0] :: Intel Corporation on linux
    Type "help", "copyright", "credits" or "license" for more information.
    Intel(R) Distribution for Python is brought to you by Intel® Corporation.
    Please check out: https://software.intel.com/en-us/python-distribution 
  • Windows:
    Python 3.9.10 (main, Mar 21 2022, 08:44:00) [MSC v.1916 64 bit (AMD64)] :: Intel Corporation on win32
    Type "help", "copyright", "credits" or "license" for more information.
    Intel(R) Distribution for Python is brought to you by Intel Corporation.
    Please check out: https://software.intel.com/en-us/python-distribution

These methods can be used as a sanity check that Intel Distribution for Python is properly installed.

Sample Code

Run this numpy sample code in a stock Python* environment comparing to a IntelPython environment. You will see benefits from IntelPython.

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)

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, reach it in Reference Section.

Reference

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 IntelPython 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.

Product and Performance Information

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