Issue with Python Path. "ImportError: No module named setuptools"


I recently updated to Python 2.7 in order to start working with Django "Django requires Python, specifically Python 2.6.5 - 2.7.x."

As a result I needed to install some of the tools I have been using when I went through the excellent LPTHW Exercise 46

  1. pip from
  2. distribute from
  3. nose from
  4. virtualenv from

Should be easy enough, I had done it all before...

When I run python in terminal I get the below. Note: Python 2.7.5

$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

When I type "which python" I get

$ which python

However when I try to install distribute, nose or virtualenv I get the below error. Note Python/2.6

$ sudo pip install distribute
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.3.1-py2.6.egg/pip/", line 139, in main
status =, args)
File "/Library/Python/2.6/site-packages/pip-1.3.1-py2.6.egg/pip/commands/", line 258, in run
import setuptools
ImportError: No module named setuptools

Storing complete log in /Users/brendanspillane/Library/Logs/pip.log
localhost:~ brendanspillane$ 

I believe the Python/2.6 is the issue here. As a result i tried to set my Python Path (my first time) Using this question as a reference "changing python path on mac?" i typed in

export PATH

This has no apparent effect.

However I am still not able to run sudo pip install distribute and keep getting the same error.

Can anyone help me? Is it my Python Path? or am I looking in the wrong direction?

Any help is as always, much appreciated.


5/23/2017 11:59:30 AM

Accepted Answer

I'm not really sure how it worked but it did. @Robert Lujo deserves the up votes for his answer at

If the answer is also added here i will accept it.

5/23/2017 12:07:47 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow