Broke Python on Mac by uninstalling Python wrong, how to get Modules to work again?
Question: I'm trying to use Python with the Twisted framework, and have been struggling
to get it running.

I've got some dirt simple python code:

    
    
    from twisted.internet import reactor
    reactor.run()
    

Buy when I run `python server.py` I get back:

>
>       File "server.py", line 1, in <module>
>         from twisted.internet import reactor   File
> "/Library/Python/2.7/site-packages/twisted/__init__.py", line 53, in
>     <module>
>         _checkRequirements()   File "/Library/Python/2.7/site-
> packages/twisted/__init__.py", line 37, in
>     _checkRequirements
>         raise ImportError(required + ": no module named zope.interface.")
> ImportError: Twisted requires zope.interface 3.6.0 or later: no module
>     named zope.interface.
>  

My first assumption was to run `pip install zope.interface`

Unfortunately, all I get from this is:

>
>     Requirement already satisfied (use --upgrade to upgrade):
>     zope.interface in
>
> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
>     Requirement already satisfied (use --upgrade to upgrade): setuptools
>     in
>
> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
>     (from zope.interface)
>  

I also tried `easy_install zope.interface`

But that yields similar results:

>
>     Searching for zope.interface
>     Best match: zope.interface 4.1.1
>     zope.interface 4.1.1 is already the active version in easy-install.pth
>  
>     Using
> /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
>     Processing dependencies for zope.interface
>     Finished processing dependencies for zope.interface
>  

Since apparently zope is installed on my machine, I'm thinking that the
problem could possibly be with the python I've got installed. I installed
Python3 with brew earlier this year, and I think I may have messed up the
python configuration. Any ideas?

**Update** The default python that is on mac should work for everything I was
trying to do above, I verified this on another mac computer. The problem I was
having was that I had corrupted my default python image that came with my mac.
By following the post below I was able to create working virtualenv again for
my python.


Answer: You should do all of your Python work in a
[virtualenv](https://virtualenv.readthedocs.org/en/latest/). If you were to
make a fresh virtualenv for your Twisted development, and always activate it
before working on it, you would have much tighter control over what gets
installed and it would be a lot easier to diagnose problems. So please make a
new virtualenv and `pip install twisted` in it, and then this problem should
go away.

