Intel® Distribution for Python*
Support and discussions for achieving faster Python* applications and core computational packages.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

python -m venv fails: returned non-zero exit status 1

rouberol
Beginner
10,758 Views

Hi

using intelpython3-2018.3-039.x86_64 on CentOS-7.5


candid01: ~ > python
Python 3.6.3 |Intel Corporation| (default, May  4 2018, 04:22:28)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] 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
>>>
candid01: ~ > python -m venv  foo # this one fails, no activate generated
Error: Command '['/home/rouberol/foo/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
candid01: ~ >

candid01: ~ >  python -m venv  --without pip   foo # this one succeeds
candid01: ~ >

But I need pip in my foo venv!

Any bug fix/workaround/idea ?

Tia

sr

0 Kudos
3 Replies
Rohit_J_Intel
Employee
10,758 Views

Hi,

This doesn't work since we don't build CPython with "ensurepip" enabled. I can provide a workaround for you to create a venv with pip in it:

##assuming that you have internet access
python -m venv foo --without-pip
source foo/bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python

Your activated env would have pip in it.

Thanks,
Rohit

rouberol
Beginner
10,758 Views

Hi

thanks for the workaround.

Out of curiosity, do you intend to fix this problem in next release?

It may be inconvenient in present state if no internet access.

Regards,

sr

 

HimanshuG
Beginner
10,758 Views

+1 for request about being able to conveniently set up virtual environments using venv.  Glad to find this workaround.  Thanks @RohitJ

Reply