1 votos

ModuleNotFoundError: No hay módulo denominado 'colección' cuando la instalación de robotpy-cscore

Cuando el uso de pip para descargar robotpy-cscore en mi Mac, me encontré con

pip3 install robotpy-cscore

Sin embargo, tengo:

Collecting robotpy-cscore
  Using cached https://files.pythonhosted.org/packages/3e/2a/9c26d834bbc281c4c3a6e5dc2978936ffabee0fc9e9355e47cf20fd77e91/robotpy-cscore-2019.0.3.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in /Users/coco/.virtualenvs/cv/lib/python3.6/site-packages (from robotpy-cscore) (1.16.0)
Requirement already satisfied: pynetworktables in /Users/coco/.virtualenvs/cv/lib/python3.6/site-packages (from robotpy-cscore) (2019.0.0)
Building wheels for collected packages: robotpy-cscore
  Building wheel for robotpy-cscore (PEP 517) ... error
  Complete output from command /Users/coco/.virtualenvs/cv/bin/python3.6 /Users/coco/.virtualenvs/cv/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/tmphoidgv_v:
  ['cscore_src/cscore/src/main/native/cpp/cscore_c.cpp', 'cscore_src/cscore/src/main/native/cpp/Frame.cpp', 'cscore_src/cscore/src/main/native/cpp/cscore_cpp.cpp', 'cscore_src/cscore/src/main/native/cpp/CvSourceImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/SinkImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/Notifier.cpp', 'cscore_src/cscore/src/main/native/cpp/PropertyImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/HttpCameraImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/cscore_oo.cpp', 'cscore_src/cscore/src/main/native/cpp/SourceImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/MjpegServerImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/CvSinkImpl.cpp', 'cscore_src/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp', 'cscore_src/cscore/src/main/native/cpp/Instance.cpp', 'cscore_src/cscore/src/main/native/cpp/Telemetry.cpp', 'cscore_src/cscore/src/main/native/cpp/PropertyContainer.cpp', 'cscore_src/cscore/src/main/native/cpp/JpegUtil.cpp', 'cscore_src/cscore/src/main/native/osx/UsbCameraImpl.cpp', 'cscore_src/cscore/src/main/native/osx/NetworkListener.cpp', 'cscore_src/cscore/src/main/native/osx/NetworkUtil.cpp']
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.13-x86_64-3.6
  creating build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/_logging.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/version.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/_info.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/imagewriter.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/__init__.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/cameraserver.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/grip.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  copying cscore/__main__.py -> build/lib.macosx-10.13-x86_64-3.6/cscore
  running build_ext
  creating var
  creating var/folders
  creating var/folders/cr
  creating var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn
  creating var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/tmpae893fq8.cpp -o var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/tmpae893fq8.o -std=c++14
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/tmp610i1flg.cpp -o var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/tmp610i1flg.o -fvisibility=hidden
  building 'cscore._cscore' extension
  Traceback (most recent call last):
    File "/Users/coco/.virtualenvs/cv/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line207, in <module>
      main()
    File "/Users/coco/.virtualenvs/cv/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/coco/.virtualenvs/cv/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line141, in build_wheel
      metadata_directory)
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in build_wheel
      _run_setup()
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 85, in _run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 248, in <module>
      entry_points={"robotpylib": ["info = cscore._info:Info"]},
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 143, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
      _build_ext.run(self)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "setup.py", line 131, in build_extensions
      build_ext.build_extensions(self)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/private/var/folders/cr/kckt74850vs4b7zqmf6yjbmw0000gn/T/pip-build-env-qutinny9/overlay/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 199, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
      depends=ext.depends)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 566, in compile
      depends, extra_postargs)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 341, in _setup_compile
      pp_opts = gen_preprocess_options(macros, incdirs)
    File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 1075, in gen_preprocess_options
      pp_opts.append("-I%s" % dir)
    File "setup.py", line 66, in __str__
      import numpy as np
  ModuleNotFoundError: No module named 'numpy'

  ----------------------------------------
  Failed building wheel for robotpy-cscore
  Running setup.py clean for robotpy-cscore
Failed to build robotpy-cscore
Could not build wheels for {} which use PEP 517 and cannot be installed directly

He opencv4, NumPy en mi Mac, ¿qué debo hacer?

1voto

Oskar Puntos 1242

De acuerdo a ese proyecto hay un problema con su paquete seleccionado y opencv4 por lo que se quiere instalar opencv3 que es compatible:

Si continúa leyendo, el OP tenido que descargar desde la fuente, instalar pygind11 y, a continuación, ejecutar el pip desde dentro del compilado opencv3 directorio y :

git submodule init
git submodule update

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X