Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
424 Discussions

Virtualenv not working with intel python

Smit__Peter
Beginner
2,381 Views

When trying to create a virtualenv with intel python (on linux, both versions 2.7 and 3.5) I get the following error:

opt/intelpython3/2017.0.010/bin/pip install virtualenv (this command succeeds)

opt/intelpython3/2017.0.010/bin/virtualenv env_ip3                                                                                                                               :(
Using base prefix '.../opt/intelpython3/2017.0.010'
New python executable in ..../env_ip3/bin/python3.5
Also creating executable in ...../env_ip3/bin/python
.../env_ip3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable ..../env_ip3/bin/python3.5 is not functioning
ERROR: It thinks sys.prefix is '...' (should be '.../env_ip3')
ERROR: virtualenv is not compatible with this system or executable

(note, all path prefixes are replaced by ... )

Does the intel python distribution support virtualenv?

0 Kudos
8 Replies
Robert_C_Intel
Employee
2,380 Views

I reproduced the behavior that you are seeing. Python3 has a built-in virtualenv, and that works as shown below. I noticed that pyvenv-3.5 works, but not pyvenv so I need to investigate. I will also look at the issues with virtualenv for python2 & python3.

 

rscohn1@vagrant-ubuntu-trusty-64:~$ intel/intelpython35/bin/pyvenv-3.5 foo
rscohn1@vagrant-ubuntu-trusty-64:~$ ls foo/
bin  include  lib  lib64  pyvenv.cfg
rscohn1@vagrant-ubuntu-trusty-64:~$ ls foo/bin/
activate          easy_install-3.5  python            python3.5
activate.csh      pip               python2           
activate.fish     pip3              python2.7         
easy_install      pip3.5            python3           
rscohn1@vagrant-ubuntu-trusty-64:~$ source foo/bin/activate
(foo) rscohn1@vagrant-ubuntu-trusty-64:~$ which python
/home/rscohn1/foo/bin/python
(foo) rscohn1@vagrant-ubuntu-trusty-64:~$ 

 

0 Kudos
Robert_C_Intel
Employee
2,381 Views

Virtualenv is not supported on linux. Please try to use pyvenv-3.5 and conda to manage virtual environments. The next release will fix pyvenv, so you can use either pyvenv or pyvenv-3.5.

We build python using a shared library. This enabled compatibility with Theano and some other packages, but is not supported by virtualenv: https://github.com/pypa/virtualenv/issues/216

We can look into fixing virtualenv, but it has been a known issue for many years and also affects anaconda (https://github.com/conda/conda/issues/1573), so there might be blocking issues.

0 Kudos
vahtras__olav
Beginner
2,381 Views

The first line of pyvenv is

#!/opt/anaconda1anaconda2anaconda3/bin/python3.5

not a very likely installation path. Is that deliberate?

0 Kudos
Andres_G_Intel1
Employee
2,381 Views

Hello Olav,

Thanks for using our product! Regarding your problem, this was not deliberate and has been fixed for our Beta Update release. In the mean time, you can circumvent this problem by running 'python pyvenv <name_of_environment> && source <name_of_environment>/bin/activate'.

Andres

 

Edit from Robert. The Beta Update was released and the workaround is not necessary anymore.

0 Kudos
Robert_C_Intel
Employee
2,381 Views

I didn't know about pyenv. We haven't done the work to make it possible to install through pyenv so you will have to install manually. We will look into this for the future.

0 Kudos
Robert_C_Intel
Employee
2,381 Views

If you are ok with an alternative to pyenv, you can use conda to manage virtual environments. Conda is installed with Intel Python. 

Create an environment called idp with the core packages:

conda create -n idp -c intel intelpython3_core python=3

or create a virtual environment with all packages that were originally installed with Intel Python

conda create -n idp --clone root

Activate with:

source activate idp

On Linux & OSX, or

activate idp

On windows. You may have to prefix conda and activate with the installation path

0 Kudos
abarb
Beginner
2,381 Views

Robert Cohn, when you will fix the problem of update?

The following packages will be DOWNGRADED:
 
    bzip2:             1.0.6-intel_py27_2    [intel vc9] --> 1.0.6-intel_py2.7_1  [intel]
    freetype2:         2.6-intel_py27_2      [intel vc9] --> 2.6-intel_py2.7_1    [intel]
    hdf5:              1.8.16-intel_py27_2   [intel vc9] --> 1.8.16-intel_py2.7_1 [intel]
    icc_rt:            14.1.5-intel_py27_2   [intel    ] --> 14.1.5-intel_py2.7_1 [intel]
    libpng:            1.6.18-intel_2        [intel    ] --> 1.6.18-intel_py2.7_1 [intel]
    llvm:              3.7.0-intel_2         [intel    ] --> 3.6.2-intel_py2.7_1  [intel]
    python:            2.7.11-intel_py27_2   [intel    ] --> 2.7.11-intel_py2.7_1 [intel] THIS PROBLEM.
 

Robert Cohn (Intel) wrote:

If you are ok with an alternative to pyenv, you can use conda to manage virtual environments. Conda is installed with Intel Python. 

Create an environment called idp with the core packages:

conda create -n idp -c intel intelpython3_core python=3

or create a virtual environment with all packages that were originally installed with Intel Python

conda create -n idp --clone root

Activate with:

source activate idp

On Linux & OSX, or

activate idp

On windows. You may have to prefix conda and activate with the installation path

0 Kudos
koenka__joel
Beginner
2,381 Views

Hello,

It was mentioned that this will be fixed in future releases. Was this ever solved?

I tried creating a venv with the latest release (2018) but no success.

Thanks,

Joel

0 Kudos
Reply