Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
448 ディスカッション

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

rouberol
ビギナー
23,746件の閲覧回数

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 件の賞賛
3 返答(返信)
Rohit_J_Intel
従業員
23,746件の閲覧回数

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
ビギナー
23,746件の閲覧回数

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
ビギナー
23,746件の閲覧回数

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

返信