python - Error when "import requests" - "No module named requests" -


n00b altert.

so tried call "import requests" through python , got error:

>>> import requests traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named requests 

i not think have pip installed correctly or @ all?

easy_install requests returns: following error occurred while trying add or remove files in installation directory:

[errno 13] permission denied: '/library/python/2.7/site-packages/test-easy-install-6488.pth' 

the installation directory specified (via --install-dir, --prefix, or distutils default setting) was:

/library/python/2.7/site-packages/ 

any on appreciated... have seen other posts users mentioning same doesn't seem help.

according requests website installation page:

  1. checkout git repository
  2. execute /path/to/virtualenv/bin/python requests/setup.py install

as third step, if have problems doing this, please come , leave comment, such may further.

your problem permissions problem. solution i'd recommend pip install virtualenv , create new environment project, installing requests in environment.

to install pip, curl -ko https://bootstrap.pypa.io/get-pip.py , run python get-pip.py install virtualenv in above paragraph.


Comments