Python ImportError:没有名为svmcmpl的模块
我正在研究支持向量机,我发现了一个有趣的例子。我已经安装了cvxopt,但是Python ImportError:没有名为svmcmpl的模块,python,svm,importerror,cvxopt,Python,Svm,Importerror,Cvxopt,我正在研究支持向量机,我发现了一个有趣的例子。我已经安装了cvxopt,但是svmcmpl没有与cvxopt一起安装,我找不到如何安装它。页面中有chompack,但我也安装了它 >>> import cvxopt >>> import chompack >>> import svmcmpl Traceback (most recent call last): File "<stdin>", line 1, in <mo
svmcmpl
没有与cvxopt一起安装,我找不到如何安装它。页面中有chompack
,但我也安装了它
>>> import cvxopt
>>> import chompack
>>> import svmcmpl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'svmcmpl'
日志:
$ 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
我给这篇文章的作者发了电子邮件,他给了我答案
svmcmpl
根本不是一个模块,它是一个脚本,可以在文章的网站上下载。你有没有尝试过sudopip安装svmcmpl
?我尝试过@Caridorc,我会在问题中添加输出。你能发布.pip/pip.log
的内容吗?错误消息很可能是there@Caridorc当然这是一个好主意,如何运行svmcmpl?请您帮忙好吗?@Creator下载带有代码的zip并正常导入,例如:cd Downloads/svmcmpl&&python
和>>导入svmcmpl
谢谢,但问题是svmcpml我需要chompack。我无法安装chompack。它抱怨说“complex.h”不存在。你知道问题是什么吗?这个问题类似于@Creator是的,你需要同时安装$pip install chompack
和$pip install cvxopt
我在mac和linux上都试过了,效果很好。
$ 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