Tuesday, June 28, 2016

pip: How to install venv and pip with a python 3.4 distribution

If you are unfortunate enough to have stuck with a Python 3.4 distribution and you want to setup a virtual env, then likely you will get the ensurepip module not found error:

bash> python3.4 -m venv mypy
Error: Command '['/home/zedeng/py-dev/mypy/bin/python3.4', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1


I found someone posted a nice solution [1] to this. So first remove the dir first.
bash> rm -r mypy

Now do it again like this:
bash> python3.4 -m venv mypy --without-pip
bash> . mypy/bin/activate
 

mypy> wget https://bootstrap.pypa.io/get-pip.py
mypy> python get-pip.py

mypy> pip list 

Now the problem is solved. I believe this problem is gone if you upgrade to Python 3.5

[1] http://www.thefourtheye.in/2014/12/Python-venv-problem-with-ensurepip-in-Ubuntu.html

8 comments:

  1. Good article,Keep posting like this article,it helpful to us,thank you
    For better sofa renovation contact thesofastore gives best
    Best Sofa Repair Services in Bellandur,Bangalore

    ReplyDelete
  2. Very good article,Thank you
    For web design & development service contact Multisoft digital technologies, They have
    Web Development in Tumkur

    ReplyDelete
  3. Nice blog with good content,thanks for sharing.
    Visit our website for best astrological services contact. Vashikaran Astrologer in Okalipuram

    ReplyDelete
  4. Nicely well-written article. It was an awesome article to read. Complete rich content and fully informative
    For Astrological service contact Shri Durga astro center,They gives
    Best Astrologer in Bellary

    ReplyDelete
  5. Hii your blog is looking good. Thanks for sharing this information and keep posting.
    For better sofa renovation contact thesofastore gives best
    Sofa Refurbishing in Padmanabhnagar,Bangalore

    ReplyDelete
  6. Thanks for sharing, nice post! Post really providing useful information!
    For best indian astrology services contact us Best Astrologer in Malleswaram


    ReplyDelete
  7. Good astrologycal post it help to know more about marriage horoscope,thank you for sharing with community.
    For sofa repair work contact thesofastore gives Best Sofa Repair Services in Kodigehalli,Bangalore

    ReplyDelete