Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's what I did that made it work; open up iypthon through the command line and type </p> <pre><code>import sys sys.path </code></pre> <p>This shows a list of folders where other python modules are located. For me this was: </p> <pre><code>['', '/Library/Frameworks/Python.framework/Versions/7.3/bin', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/pandas-0.10.0-py2.7-macosx-10.5-i386.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/googlemaps-1.0.2-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/oauth-1.0.1-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/oauth2-1.5.211-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/httplib2-0.7.7-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/selenium-2.28.0-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/jellyfish-0.2.0-py2.7-macosx-10.5-i386.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/python_yelp-0.1.1-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/pymongo-2.4.2_-py2.7-macosx-10.5-i386.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/lucene_querybuilder-0.1.6-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/html2text-3.200.3-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/lib-dynload', '/Users/vincentwarmerdam/Library/Python/2.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/PIL', '/Library/Python/2.7/site-packages', '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/IPython/extensions] </code></pre> <p>With this information, I now knew where ipython looks for the modules that one can import. So I downloaded the requests library manually, added it to the same root directory such that the following directory exists: </p> <pre><code>/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/requests </code></pre> <p>This folder contains the python modules that belong to requests. The only thing I now had to do was to make sure that ipython knows that this folder exists. Which was done by updating the sys.path. </p> <pre><code>req_link = '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/requests' sys.path.append(req_link) </code></pre> <p>After this I no longer got the error. </p> <pre><code>import requests </code></pre> <p>Just works. </p> <p>Also after restarting ipython, I found that ipython automatically updates the new path into the <code>sys.path</code> list. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload