Wednesday, November 5, 2014

Lessons learned: don't remove python3 on Ubuntu. Also, how to get a python3 virtual environment with ubuntu 14.4

I was trying to create a virtual environment for python3.4 when I ran into the problem described here:

https://lists.debian.org/debian-python/2014/03/msg00045.html

Apparently, python 3.4 is deliberately broken by default in a way that pops up when you try to set up the virtual environment in the ordinary way.  To quote the source:



The current situation in the Python 3.4 package  
is suboptimal because:

% pyvenv-3.4 /tmp/zz
Error: Command '['/tmp/zz/bin/python3.4',  
'-Im', 'ensurepip', '--upgrade', '--default-pip']'  
returned non-zero exit status 1

Although `virtualenv -p python3.4 /tmp/zz` does work.
The bottom line in the quote above provided the key solution.  But only after my big mistake.

My big mistake: removing python3

apt has me so spoiled that instead of turning to Google with the error message, I tried removing python3 with the plan to then reinstall it.  It was while watching the messages pour out of package after package being removed that I realized my mistake.  I had pulled out a critical part of the modern ubuntu environment and everything built on top of it was being removed.  So I'm backing up all files on that installation and re-installation is coming soon.

No comments:

Post a Comment