Z
Z
zelsky2014-12-14 20:58:33
Python
zelsky, 2014-12-14 20:58:33

Problem with pip and python 3?

Trying to install pip install python-twitter.
B here is what I get that the package takes under the 3rd version which is also installed how to change the default usage for 2.7?

[email protected]:~$ sudo pip install python-twitter
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in
from pip import main
File "/usr/local/lib/python3 .2/dist-packages/pip/__init__.py", line 11, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/lib/python3.2/dist-packages/pip /vcs/mercurial.py", line 9, in
from pip.download import path_to_url
File "/usr/local/lib/python3.2/dist-packages/pip/download.py", line 22, in
from pip._vendor import requests, six
File "/usr/local/lib/python3.2/dist-packages/pip/_vendor/requests/__init__.py", line 58, in
from . import utilities
File "/usr/local/lib/python3.2/dist-packages/pip/_vendor/requests/utils.py", line 25, in
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python3. 2/dist-packages/pip/_vendor/requests/compat.py", line 77, in
import simplejson as json
File "/usr/local/lib/python3.2/dist-packages/simplejson/__init__.py", line 114, in
from .encoder import JSONEncoder, JSONEncoderForHTML
File "/usr/local/lib/python3.2/dist-packages/simplejson/encoder.py", line 21
ESCAPE = re.compile(u'[\\x00-\ \x1f\\\\"\\b\\f\\n\\r\\t\u2028\u2029]')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2014-12-14
@zelsky

sudo pip2 install python-twitter

D
Dmitry Lavrentiev, 2014-12-14
@TreyLav

I think a solution with a separate virtualenv environment will suit you:

  1. Install virtualenv on your system (the following is an example for Linux).
  2. Create a new environment with a console command
    virtualenv ~/my_env_for_work -p /usr/bin/python2.7
  3. Activate the environment
    source ~/my_env_for_work/bin/activate
  4. Install the required package.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question