0

Currently I can use py2.7 by using a terminal alias. My problem is that when I try and run a script, it depends on a module requests. I have tried to pip install this and even download the requests2.7 folder and sudo python setup.py install. Even though I was aliased with python2.7, This resulted in it being downloaded to my python 3.5 site.

Installed /anaconda/lib/python3.5/site-packages/requests-2.7.0-py3.5.egg Processing dependencies for requests==2.7.0 Finished processing dependencies for requests==2.7.0

How can I fix this? I need to run scripts as 2.7 but my default seems to be 3.5.

user82395214
  • 829
  • 14
  • 37
  • 1
    you should have `pip2` to install modules for Python 2, and `pip3` to install modules for Python 3. Or you can use `python2 -m pip install requests` – furas Nov 06 '16 at 01:47
  • 1
    try pip2.7 install requests – Jordan McQueen Nov 06 '16 at 01:48
  • @furas After I command `python2.7 -m...` i get the error `no module named install. Or, how can I install pip2? – user82395214 Nov 06 '16 at 02:53
  • 1
    `no module named install` ? it seems you use `-m install` but you should `-m pip install` – furas Nov 06 '16 at 02:56
  • 1
    Python 2.7 should have `pip2` installed. Did you try to use `pip2` in terminal` ? – furas Nov 06 '16 at 02:59
  • @furas That was probably it, but now I get the error `no module pip`. I tried [this](https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip) installation guide for pip but I got the error `Could not find a version that satisfies the requirement pip (from versions: ) No matching distribution found for pip` when I ran `get-pip.py` – user82395214 Nov 06 '16 at 02:59
  • Oh and yes I tried `pip2` – user82395214 Nov 06 '16 at 03:02
  • 1
    I don't know - maybe it need `setuptools`. What system do you use ? Windows/Linux/Mac ? – furas Nov 06 '16 at 03:13
  • @furas I use a Mac – user82395214 Nov 06 '16 at 03:16
  • I use Linux and has `apt` to install different program - and there is `python-pip` for old Python. As I know you should have `brew` and maybe there is something similar. http://stackoverflow.com/questions/17271319/how-to-install-pip-on-mac-os-x – furas Nov 06 '16 at 03:48

0 Answers0