问题
This is embarrassing to admit, but I just continue to struggle with setting up my Python environment on an Ubuntu install.
Sometimes I get it to work fine. But here's the problem:
I feel like whenever I sit down to do some hobby hacking on a python project, I end up spending hours on end just trouble shooting inconsistencies with my python installation. Right now I keep getting an error message of:
ImportError: cannot import name urandom
when trying to import a module called googleplaces (https://github.com/slimkrazy/python-google-places).
But it's always something that causes me to go on an endless snipe hunt for the proper configuration of this that or the other.
I just want to work on the project, not plumb around endlessly in forums.
Which brings me to my point: How do I completely nuke my existing python setup (including virtualenv, pip, easy_install, etc. etc.) and just start from a completely clean slate? I have already tried reinstalling everything python from synaptic, but no success, still getting error.
UPDATE: I've reinstalled virtualenv and that seems "ok" so far. Found that my import error is a permissions problem, if I import in the interactive using sudo, it passes fine. How should I be correcting my permissions so I don't have to run sudo? (Probably close this and start a new question.)
来源:https://stackoverflow.com/questions/12449161/complete-removal-and-fresh-install-of-python-on-ubuntu-12-04