我正在尝试使用setuptools在Ubuntu 14.04上安装PyOpenCV.当我尝试
python setup.py config
我收到了错误
ImportError: cannot import name Library
我在上一个问题的答案中发现修复是要改变的
from setuptools import Library
至
from setuptools.extension import Library
在setup.py中.现在,当我运行setup.py时,错误发生在它生成的config.py脚本中:
$ python setup.py config Configuring PyOpenCV via CMake...-- Configuring done -- Generating done -- Build files have been written to: /home/saul/Downloads/pyopencv/build Traceback (most recent call last): File "setup.py", line 137, in import config as C File "/home/saul/Downloads/pyopencv/config.py", line 1, in from setuptools import Extension, Library ImportError: cannot import name Library
config.py的第一行包含相同的导入错误.我当然可以更正config.py,但我不知道如何恢复构建过程.
从失败点出发的setup.py文本是:
import config as C setup( name = "pyopencv", version = C.PYOPENCV_VERSION, description = DOCLINES[0], author = 'Minh-Tri Pham', author_email = 'pmtri80@gmail.com', url = 'http://code.google.com/p/pyopencv/', license = 'New BSD License', platforms = 'OS Independent, Windows, Linux, MacOS', classifiers = filter(None, CLASSIFIERS.split('\n')), long_description = "\n".join(DOCLINES[2:]), ext_modules=C.extension_list, install_requires = ['numpy>=1.2.0'], package_data = {'pyopencv': ['*.dll']}, include_package_data = True, # zip_safe = (os.name!='nt'), # thanks to ffmpeg dependency package_dir={'':'package'}, packages = find_packages('package'), )
你能告诉我如何解决这个问题,或者建议一种安装pyOpenCV的替代方法吗?