3

I want to use grab api in my coding.i have install 2.7 python and django framwork.i have also install grab-0.5.4 api in my system. here is my code:

def getGrab(request):
    g = Grab()
    g.go('https://github.com/login')
    g.set_input('login', 'lorien')
    g.set_input('password', '***')
    g.submit()
    for elem in g.doc.select('//ul[@id="repo_listing"]/li/a'):
        print '%s: %s' % (elem.text(), elem.attr('href'))
    return "yes"

I want to call from view.py file. how to resloved this error:

ImportError at /getGrab

No module named pycurl

Request Method:     GET
Request URL:    http://localhost:8000/getGrab
Django Version:     1.7.3
Exception Type:     ImportError
Exception Value:    

No module named pycurl

Exception Location:     C:\Python27\lib\site-packages\grab-0.5.4-py2.7.egg\grab\transport\curl.py in <module>, line 17
Python Executable:  C:\Python27\python.exe
Python Version:     2.7.3
Python Path:    

['E:\\twitterproject',
 'C:\\Python27\\lib\\site-packages\\setuptools-12.0.5-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django-1.7.3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\requests-2.5.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\grab-0.5.4-py2.7.egg',
 'C:\\WINDOWS\\SYSTEM32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages']

Here we need to install pycurl? if yes please let me know how to install pycurl or any thing else need to install?

thanks

Atul Thakre
  • 502
  • 3
  • 8
  • 24

2 Answers2

5

Had the same issue with python3.5 on ubuntu 14.04 when checking pydocusign version:

python -c "import pydocusign;print(pydocusign.__version__)"

The @Michael Vietluzhskih didn't help, but the command below did:

pip -v install pycurl --upgrade
Kostyantyn
  • 5,041
  • 3
  • 34
  • 30
-1

1) Open the cmd.exe

2) Run pip install pycurl

Now it must work