python - 导入错误:没有名为 svmcmpl 的模块

标签 python svm importerror cvxopt

我正在研究 SVM,发现了一个有趣的例子 here 。我已经安装了 cvxopt,但是 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'

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

$ 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

最佳答案

我给文章作者发了电子邮件,他给了我答案。

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

关于python - 导入错误:没有名为 svmcmpl 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34385048/

相关文章:

python - Pybind11 : "ImportError: DLL not found" when trying to import *. Python解释器中的pyd

Python Unicode 对象和 C API(从 pyunicode 对象中检索 char*)

python - 在 pandas DataFrame 上定期选择列

machine-learning - 如何理解SVM中的函数边际?

algorithm - LibSVM 和 LibLinear 有什么区别

python - Python 导入错误(linux)

Python:code.interact(local=locals()) 其中 stdin/stdout 不可用

python - Xpath,从div内的B中选择文本,同时也获取普通文本

python - python做手写字符识别的步骤是什么?用opencv和sci kit学习?

python - libclntsh.so.12.1 的 CX_Oracle 导入错误