different versions of python missing pymssql
Question: I have python2.7.3 in /usr/bin/

this version can import pymssql without error

i have python2.7.11 in /usr/local/bin/

this version gets an error when importing pymssql

    
    
        $ sudo pip install pymssql
        Requirement already satisfied (use --upgrade to upgrade): pymssql in /usr/local/lib/python2.7/dist-packages
        Cleaning up...
    
        $ python
        Python 2.7.11 (default, Feb  9 2016, 14:42:25)
        [GCC 4.7.2] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        />>> import pymssql
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ImportError: No module named pymssql
    
        $ which python
        /usr/local/bin/python
    

how can i install pymssql to the version of python2.7.11?


Answer: When you run `sudo pip` you are invoking `/usr/bin/python`. Install your
package without `sudo`. I agree with @Michael Frystacky--using virtualenv will
save you from using `sudo pip` ever again.

