zivid / zivid-python

Official Python package for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
40 stars 14 forks source link

Cannot install python package zivid #33

Closed DekiChan closed 4 years ago

DekiChan commented 4 years ago

Hello,

I have followed installation instructions for Python, on Ubuntu 16.04. I have installed SDK version 1.7, but when I try to install the python package with pip3 install --user zivid I get the following error:

ERROR: Failed building wheel for zivid
  Running setup.py clean for zivid
Failed to build zivid
ERROR: Could not build wheels for zivid which use PEP 517 and cannot be installed directly

Complete output is:

Collecting zivid
  Using cached https://files.pythonhosted.org/packages/39/fb/eaab49445dc6b08a28e6a66d31c1b0a6934fa136b909c5f541d15a6d3b48/zivid-0.9.1.1.6.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/d2/ab/43e678759326f728de861edbef34b8e2ad1b1490505f20e0d1f0716c3bf4/numpy-1.17.4-cp36-cp36m-manylinux1_x86_64.whl
Building wheels for collected packages: zivid
  Building wheel for zivid (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.6 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpp4u1b3bj
       cwd: /tmp/pip-install-k0dbjefr/zivid
  Complete output (72 lines):
  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 9.2.1
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The CXX compiler identification is GNU 9.2.1
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /tmp/pip-install-k0dbjefr/zivid/_cmake_test_compile/build
  -- The CXX compiler identification is GNU 9.2.1
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:14 (find_package):
    Could not find a configuration file for package "Zivid" that exactly
    matches requested version "1.6.0".

    The following configuration files were considered but not accepted:

      /usr/lib/cmake/Zivid/ZividConfig.cmake, version: 1.7.0

  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-k0dbjefr/zivid/_skbuild/linux-x86_64-3.6/cmake-build/CMakeFiles/CMakeOutput.log".
    File "/tmp/pip-build-env-top1bqow/overlay/lib/python3.6/site-packages/skbuild/setuptools_wrap.py", line 574, in setup
      languages=cmake_languages
    File "/tmp/pip-build-env-top1bqow/overlay/lib/python3.6/site-packages/skbuild/cmaker.py", line 232, in configure
      os.path.abspath(CMAKE_BUILD_DIR())))

  --------------------------------------------------------------------------------
  -- Trying "Ninja" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja" generator - success
  --------------------------------------------------------------------------------

  Traceback (most recent call last):

  An error occurred while configuring with CMake.
    Command:
      "cmake" "/tmp/pip-install-k0dbjefr/zivid" "-G" "Ninja" "-DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-k0dbjefr/zivid/_skbuild/linux-x86_64-3.6/cmake-install" "-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6" "-DPYTHON_VERSION_STRING:STRING=3.6.9" "-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.6m" "-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.6m.so" "-DSKBUILD:BOOL=TRUE" "-DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-top1bqow/overlay/lib/python3.6/site-packages/skbuild/resources/cmake" "-DZIVID_PYTHON_VERSION=0.9.1.1.6.0" "-DZIVID_SDK_VERSION=1.6.0" "-Dpybind11_DIR=src/3rd-party/pybind11-2.2.4/share/cmake/pybind11/" "-DCMAKE_BUILD_TYPE:STRING=Release"
    Source directory:
      /tmp/pip-install-k0dbjefr/zivid
    Working directory:
      /tmp/pip-install-k0dbjefr/zivid/_skbuild/linux-x86_64-3.6/cmake-build
  Please see CMake's output for more information.
  ----------------------------------------
  ERROR: Failed building wheel for zivid
  Running setup.py clean for zivid
Failed to build zivid
ERROR: Could not build wheels for zivid which use PEP 517 and cannot be installed directly

Which makes me think that Python package requires SDK version 1.6? If so, where could I get the older versions? I was unable to find them on Github or the website.

Running the command with version specified errored out:

pip3 install --user zivid==1.0.0.1.7.0
ERROR: Could not find a version that satisfies the requirement zivid==1.0.0.1.7.0 (from versions: 0.9.1.1.3.0, 0.9.1.1.4.0, 0.9.1.1.5.0, 0.9.1.1.6.0)
ERROR: No matching distribution found for zivid==1.0.0.1.7.0
trym-b commented 4 years ago

We have not created a release for zivid-python that that builds against SDK version 1.7.0 for the latest master as of now, it will be out shortly.

In the meantime, you should be able to build the repository locally, by running pip install . This assumes that you have the proper dependencies installed, as mentioned in the top-level readme.

eskaur commented 4 years ago

Alternatively, if you would rather use SDK 1.6 for now, you can find the installers here: http://www.zivid.com/downloads/revisions

DekiChan commented 4 years ago

Thank you for fast response, I was able to install python package (both for SDK version 1.5 and 1.6).

But now I have a new problem. Camera is detected, but I cannot connect to it.

The following code (SDK version 1.6, happens with 1.5 too):

import zivid

print("started")

app = zivid.Application()
print("app created")

cams = app.cameras()
settings = None

print("cameras detected:")
for cam in cams:
    print(cam)
    settings = cam.settings
    print("settings:")
    print(settings)

camera = app.connect_camera()

will end with cryptic Trace/breakpoint trap message. This is full output:

started
app created
cameras detected:
{ Camera info: { Model Name: Zivid One Plus M, Serial Number: <SERIAL_NUMBER>, Hardware Revision: { Major: 3, Minor: 2 }, Firmware Version: 1.6.6, USB Path: na, Internal camera id: <CAMERA_ID> } }
settings:
Settings:
bidirectional: False
blue_balance: 1.081
brightness: 1.0
exposure_time: 0:00:00.008333
filters: Filters:
contrast: Contrast:
enabled: True
threshold: 5.0
outlier: Outlier:
enabled: True
threshold: 5.0
saturated: Saturated:
enabled: True
reflection: Reflection:
enabled: False
gaussian: Gaussian:
enabled: False
sigma: 1.5
gain: 2.0
iris: 22
red_balance: 1.709
Trace/breakpoint trap

If this might not be the best place to continue I can send you an email?

trym-b commented 4 years ago

I just tried your sample on the just released 0.9.1.1.7.0 version (supporting 1.7.0) and I ran your script without any issues.

Could you try to do the following: uninstall the Zivid SDK install the latest Zivid SDK (version 1.7.0 as of right now) and then run the following commands:

pip uninstall --yes zivid
pip install zivid

If this does not solve your problem, you can mail us through customersuccess@zivid.com or you can create a new issue.

eskaur commented 4 years ago

Does the following minimal example run for you?: @DekiChan

import zivid
app = zivid.Application()
cam = app.connect_camera()
print(cam.settings)
DekiChan commented 4 years ago

Nope, with SDK 1.6 is still the same, Trace/breakpoint trap. However, C++ samples do work on the same machine, with the same camera.

With SDK 1.7 I get (both for Python and C++ samples):

RuntimeError: Camera and API firmware mismatch:{ API supported firmware: 1.6.7, Camera Info: { Model Name: Zivid One Plus M, Serial Number: <SERIAL>, Hardware Revision: { Major: 3, Minor: 2 }, Firmware Version: 1.6.6, USB Path: na, Internal camera id: <INTERNAL_ID> } }
eskaur commented 4 years ago

Not sure why you get that issue with SDK 1.6

Regarding the SDK 1.7 problem: This happens because the camera is loaded with SDK 1.6's firmware. You can upgrade the firmware through the Python API, but the simplest way would be to just run the Zivid Studio from SDK 1.7 and click the firmware-upgrade button.

DekiChan commented 4 years ago

Ok, thank you for your help. I managed to test what I needed right now with C++ ROS packages. I'll update the firmware tomorrow and try to set-up the system on a fresh install of Ubuntu.

nedrebo commented 4 years ago

Closing this as the original issue is resolved by the release of 1.7.0 pip package.

We also want to help you with the other issues you face with the python interface. Feel free to continue the discussion here or contact us at customersuccess@zivid.com. If you send us an email, refer to this issue and ask for @trym-b or @eskaur. @SatjaSivcev FYI.

DekiChan commented 4 years ago

Hey,

I've updated the firmware on the camera and it works fine with Zivid Studio and with C++ examples. The problem with Python package remains, so I assume that it is a problem with Python installation , but right now I don't have time to completely reinstall the OS.

I'll keep you posted on my findings, sometime by the end of the week probably.

eskaur commented 4 years ago

So what is the remaining issue now? Trace/breakpoint trap-thing? If so, could you please make another issue here? This issue is closed because it was named as Cannot install python package, which seems to be solved. Sorry for the inconvenience :)

DekiChan commented 4 years ago

Yep, the remaining issue is Trace/breakpoint trap thing. Will open another issue.

mortlind commented 3 years ago

I am on Debian with Python 3.8, and can install 2.1.0 core and telicam driver fine, and pip install zivid succeeds. But any attempt at getting the camera, or the file for simulating a frame from the camera, results in Trace/breakpoint trap. E.g.

>>> camera = app.create_file_camera("ZividSampleData2/FileCameraZividOne.zfc")
Trace/breakpoint trap

Is there any easy fix for this? I did not find a new, relevant issue opened by @DekiChan ...

eskaur commented 3 years ago

I am on Debian with Python 3.8, and can install 2.1.0 core and telicam driver fine, and pip install zivid succeeds. But any attempt at getting the camera, or the file for simulating a frame from the camera, results in Trace/breakpoint trap. E.g.

>>> camera = app.create_file_camera("ZividSampleData2/FileCameraZividOne.zfc")
Trace/breakpoint trap

Is there any easy fix for this? I did not find a new, relevant issue opened by @DekiChan ...

Hi @mortlind . Thank you for bringing this to our attention. Could you create a new Issue for this? That would make it easier for us to track it, since this issue is Closed and therefore a bit invisible.