本文介绍了如何解决ImportError“没有名为pycurl的模块";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的编码中使用grab api.我已经安装了2.7 python和django framwork.我也已经在系统中安装了grap-0.5.4 api.这是我的代码:

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"

我想从view.py文件中调用.如何解决这个错误:

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']

我们需要安装pycurl吗?如果是,请让我知道如何安装pycurl或其他需要安装的东西?

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

谢谢

推荐答案

在检查pydocusign版本时,ubuntu 14.04上的python3.5出现了相同的问题:

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

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

@Michael Vietluzhskih并没有帮助,但是下面的命令做了:

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

pip -v install pycurl --upgrade

这篇关于如何解决ImportError“没有名为pycurl的模块";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 15:43