I'm having trouble installing twisted
pip --version
pip 1.1 from /home/chris/GL/GLBackend/glenv/lib/python2.7/site-packages/pip-1.1-py2.7.egg (python 2.7)
Create a virtual environment
chris@chris-mint ~/GL/GLBackend $ sudo virtualenv -p python2.7 glenv
Running virtualenv with interpreter /usr/bin/python2.7 New python executable in glenv/bin/python2.7 Also creating executable in glenv/bin/python Installing distribute.............................................................................................................................................................................................done. Installing pip...............done.
Just in case, I'll enable all permissions
chris@chris-mint ~/GL/GLBackend $ sudo chmod -R 777 glenv
chris@chris-mint ~/GL/GLBackend $ source glenv/bin/activate
(glenv)chris@chris-mint ~/GL/GLBackend $ pip freeze
argparse==1.2.1 distribute==0.6.24 wsgiref==0.1.2
twisted is not listed here as installed
(glenv)chris@chris-mint ~/GL/GLBackend $ sudo pip install twisted
Requirement already satisfied (use --upgrade to upgrade): twisted in /usr/local/lib/python2.7/dist-packages Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in /usr/local/lib/python2.7/dist-packages (from twisted) Requirement already satisfied (use --upgrade to upgrade): distribute in /usr/local/lib/python2.7/dist-packages (from zope.interface>=3.6.0->twisted) Cleaning up... (glenv)chris@chris-mint ~/GL/GLBackend $ pip uninstall twisted Cannot uninstall requirement twisted, not installed Storing complete log in /home/chris/.pip/pip.log
But when I install it it says that its already installed. Force the install:
sudo pip install -I twisted
Downloading/unpacking twisted Downloading Twisted-12.3.0.tar.bz2 (2.6Mb): 2.6Mb downloaded Running setup.py egg_info for package twisted . . .
Successfully installed twisted zope.interface distribute Cleaning up...
And yet it still isn't installed
(glenv)chris@chris-mint ~/GL/GLBackend $ pip freeze
argparse==1.2.1 distribute==0.6.24 wsgiref==0.1.2
**When I try running Python scripts which use twisted, I get an error saying that twisted is not installed. That is:
ImportError: No module named twisted.python**
sudo
withpip install
undervirtualenv
? I don't know for sure thatpip
tries to install to the system (that is, to put still in/usr/local/lib/python2.7
, as you're seeing, instead of~/glenv
, as you want) when you usesudo
, but it's at least plausible. (You also shouldn't usesudo
to create your venv in the first place.) – abarnert