python -m venv returns an error

python -m venv returns an error

I recently installed the Intel distribution for python.

The following error occurs when attempting to create a virtual environment:

python -m venv ${HOME}/venv6
Error: Command '['/N/u/hbrokaw/Carbonate/venv6/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Is there any information about what would cause this to occur and how I can fix it.


Cicada Dennis

5 帖子 / 0 全新

try the commands to  install python-virtualenv

sudo apt-get install python-virtualenv


virtualenv --python=/usr/bin/python3.4 venv

Thanks. I have already installed virtualenv as a work-around on this issue. That does not, however, explain the error in this distribution. I installed the distribution as specified on the Intel site, and "out-of-the-box", so to speak, this function of python has this error. Is this error a known problem with the current linux version of the Python distribution?

As additional info, the error returned is:

/N/u/hbrokaw/Carbonate/venv6/bin/python: No module named ensurepip

So the ensurepip is not present in the virtualenv when it tries to create pip. If one uses the --without-pip option, then the venv gets created.

This seems like a bug in the distribution.

Best Reply

Well I figured out a solution, and Intel should really fix this, it is so easy.
I downloaded the Python source code. I built it. Then I copied the directory:
install_dir/lib/python3.6/ensure_pip/ to the intel distribution's install_dir/lib/python3.6
All Intel needs to do is add that directory and its contents to their distribution.