2015-12-20 132 views
2

我正在学习SVM,我找到一个有趣的例子here。我已经安装了cvxopt,但svmcmpl没有安装在一起cvxopt,我没有找到如何安装它。在页面中提到chompack,但我也安装了它。ImportError:No module named svmcmpl

>>> import cvxopt 
>>> import chompack 
>>> import svmcmpl 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named 'svmcmpl' 

如果我尝试通过PIP安装使用名称svmcmpl我得到:

$ pip install svmcmpl 
Downloading/unpacking svmcmpl 
    Could not find any downloads that satisfy the requirement svmcmpl 
Cleaning up... 
No distributions at all found for svmcmpl 
Storing debug log for failure in /home/ademar/.pip/pip.log 

日志:

$ cat /home/ademar/.pip/pip.log 
------------------------------------------------------------ 
/usr/bin/pip run on Sun Dec 20 18:54:44 2015 
Downloading/unpacking svmcmpl 
    Getting page https://pypi.python.org/simple/svmcmpl/ 
    Could not fetch URL https://pypi.python.org/simple/svmcmpl/: 404 Client Error: Not Found 
    Will skip URL https://pypi.python.org/simple/svmcmpl/ when looking for download links for svmcmpl 
    Getting page https://pypi.python.org/simple/ 
    URLs to search for versions for svmcmpl: 
    * https://pypi.python.org/simple/svmcmpl/ 
    Getting page https://pypi.python.org/simple/svmcmpl/ 
    Could not fetch URL https://pypi.python.org/simple/svmcmpl/: 404 Client Error: Not Found 
    Will skip URL https://pypi.python.org/simple/svmcmpl/ when looking for download links for svmcmpl 
    Could not find any downloads that satisfy the requirement svmcmpl 
Cleaning up... 
    Removing temporary dir /tmp/pip_build_root... 
No distributions at all found for svmcmpl 
Exception information: 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files 
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade) 
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 277, in find_requirement 
    raise DistributionNotFound('No distributions at all found for %s' % req) 
DistributionNotFound: No distributions at all found for svmcmpl 
+1

你尝试过'sudo pip install svmcmpl'吗? – Caridorc

+1

我试了@Caridorc我会在问题中添加输出。 – ademar111190

+1

你可以发布'.pip/pip.log'的内容吗?错误信息最有可能是 – Caridorc

回答

2

我通过电子邮件发送文章的作者,他给我的回答。

svmcmpl根本不是一个模块,它是一个脚本,可以在文章的网站here下载。

+0

那么,如何运行svmcmpl?你能帮忙吗? – Creator

+0

@Creator使用代码下载zip并正常导入,例如:'cd Downloads/svmcmpl && python'和'>>> import svmcmpl' – ademar111190

+0

谢谢,但问题在于svmcpml我需要chompack。我无法安装chompack。它抱怨'complex.h'不在那里。任何想法是什么问题?这个问题类似于http://stackoverflow.com/questions/35094340/failed-with-pip-install-chompack#comment71728512_35094340 – Creator