Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rouberol
Beginner
9,972 Views

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

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
9,972 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
9,972 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
9,972 Views

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

Reply