2

I am trying to use the Intel OneAPI while being activated in an Anaconda environment. If I create an Anaconda environment first, conda env list shows

# conda environments:
#
base                     /path/anaconda3
env_name                 *  /path/anaconda3/envs/env_name

However, if I then source /opt/intel/oneapi/setvars.sh, conda env list shows

# conda environments:
#
                         /path/anaconda3
                         /path/anaconda3/envs/env_name
base                  *  /opt/intel/oneapi/intelpython/latest
2021.4.0                 /opt/intel/oneapi/intelpython/latest/envs/2021.4.0

and I cannot conda activate env_name anymore. I successfully set this up before on a different machine, and I believe that a correct setup should show for conda env list:

# conda environments:
#
base                     /path/anaconda3
env_name                 *  /path/anaconda3/envs/env_name
                         /opt/intel/oneapi/intelpython/latest
                         /opt/intel/oneapi/intelpython/latest/envs/2021.3.0

Any idea on how to properly source the Intel One API environment vars while being activated in an Anaconda environment?

FSeed
  • 31
  • 4

2 Answers2

1

Please try to use the Conda Clone Function to Add Packages as a Non-Root User.

The Intel oneAPI AI Analytics toolkit is installed in the inteloneapi folder, which requires root privileges to manage. You may wish to add and maintain new packages using Conda*, but you cannot do so without root access. Or, you may have root access but do not want to enter the root password every time you activate Conda.

To manage your environment without using root access, utilize the Conda clone functionality to clone the packages you need to a folder outside of the inteloneapi folder:

  1. From the same terminal window where you ran setvars.sh, identify the Conda environments on your system:

    conda env list
    

You will see results similar to this: img 2. Use the clone function to clone the environment to a new folder. In the example below, the new environment is named usr_intelpython and the environment being cloned is named base.

conda create --name usr_intelpython --clone base

The clone details will appear. conda If the command does not execute, you may not have access to the ~/.conda folder. To fix this, delete the .conda folder and execute this command again: conda create --name usr_intelpython --clone base.

  1. Activate the new environment to enable the ability to add packages.
conda activate usr_intelpython
  1. Verify the new environment is active.
conda env list

conda env list

Rahila T - Intel
  • 832
  • 4
  • 11
0

same problem, solved with the following command

conda activate /path/anaconda3/envs/env_name
Ethan
  • 881
  • 8
  • 14
  • 26