System designTroubleshooting

Script finds no device but viewer works: fix duplicate SDK installs

The viewer works but your Python script finds no device? Clean out every duplicate SDK install and rebuild one version against your interpreter.

LumaSpec Vision11 min read Share on LinkedIn

On this page 9 sections
  1. 01Why does the viewer find the camera while your script reports no device connected?
  2. 02Which cause do you check first?
  3. 03How do you tell which SDK build your script is actually loading?
  4. 04What does a glibc_2.29 error in the traceback mean?
  5. 05How do you remove every copy of the SDK in one pass?
  6. 06How do you install one clean SDK that matches your interpreter?
  7. 07What if the camera is still not found after the cleanup?
  8. 08How do you stop duplicate installs from coming back?
  9. 09Questions

The vendor viewer opens the camera, shows live frames and lists the device; your Python script on the same machine raises a no-device error, and no change to the code moves it. That split — one tool enumerates, the other cannot — rarely points at the camera. It points at two SDK installs living side by side and an interpreter loading a build made for a different Python version. This guide gives you the tests that separate a duplicate-install fault from an ownership or access-rights fault, the commands that remove every copy in one pass, and the rebuild that makes viewer and script agree. The same sequence covers USB and GigE area scan cameras and 3D sensors on Linux, including embedded ARM boards.

Why does the viewer find the camera while your script reports no device connected?

Because the viewer and your script are not running the same SDK build: a package-manager install and a pip or source install sit side by side on the machine, and the interpreter that runs the script loads a build made for a different Python version, which fails before enumeration even starts.

The viewer is a compiled application. It links the SDK library that the package manager or the source build placed under /usr/lib or /usr/local/lib, and it works. Your script never touches that library directly: it imports a wrapper module, and the wrapper carries its own compiled extension, pinned to one CPython version and one SDK release. When the environment's interpreter is not the one that extension was built for, the import or the first enumerate call dies, and the camera never comes into play. Nothing in the pipeline settings, the resolution or the exposure changes that outcome.

The asymmetry is the tell. A weak cable or a failing sensor fails in every tool on the machine. A build mismatch fails only in the process that loads the wrong build.

Which cause do you check first?

Work down this order: duplicate SDK installs, an interpreter-to-wrapper mismatch, an environment shadowing the right install, then device ownership and access rights — the first three explain nearly every case where the viewer still enumerates.

  1. Duplicate installs — test first. List the package-manager copies (dpkg -l | grep on the SDK name under Debian or Ubuntu), ask pip inside the environment (python -m pip list), and look for a leftover source tree with its own build directory. Two or more hits confirm the fault.
  2. Interpreter-to-wrapper mismatch. Compare the wheel tag with the interpreter. A wheel file name carrying cp39 will not import under a 3.8 interpreter, and the traceback usually names a C-library version when you try.
  3. Environment shadowing. pip --version prints the interpreter it belongs to. If that is not the interpreter you run the script with, the wrapper was installed somewhere else entirely.
  4. Device ownership. Close every viewer, sample and notebook, then run the script alone. If it enumerates alone, another process owned the device; the section after the reinstall covers the fix.
  5. Access rights. Run the script once with sudo. If it enumerates only as root, the repair is not sudo but the camera's access rule — Camera SDK cannot find device: isolate Linux access errors walks that diagnosis.

How do you tell which SDK build your script is actually loading?

Print the wrapper module's __file__ path from the same interpreter that runs the script: it names the exact compiled file being loaded, and its directory tells you whether that file came from the package manager, a pip wheel or a source build.

import your_wrapper as wr   # illustrative module name: your SDK's Python wrapper module
print(wr.__file__)          # str: full path of the build this interpreter loads

Run those two lines with the interpreter that runs your inspection script, then read the path. Inside the environment's site-packages means the pip copy. Under /usr/lib means the package manager's. Under /usr/local/lib usually means a source build. Two different paths from two interpreters is the duplicate install, proven with one command.

Pair the interpreters as well. Inside the environment, which python and python --version must agree with pip --version. A conda environment created with python=3.8 on a machine whose system python3 is 3.9 is exactly the state that builds this fault: bare pip writes into one interpreter, the script runs under the other, and the mismatch surfaces as a missing device. Installers that pick the wrong interpreter have their own case in Python camera SDK install script fails under pyenv: use pip directly.

What does a glibc_2.29 error in the traceback mean?

It means the compiled wrapper you imported was built against a newer C library or a newer CPython than your interpreter and operating system provide, so the loader stops at import time, before any camera is opened, and no SDK setting can change that outcome.

The version string in the error is the evidence. Read three numbers before deleting anything: python --version inside the environment, python3 --version outside it, and ldd --version for the C library the operating system ships. A board that lists both python3.8 and python3.9 under /usr/bin is normal on development machines; the wheel must match the interpreter inside your environment, not the newest one on the box.

A mismatch at this level also explains the second classic symptom: the wrapper imports, but enumeration still finds nothing, because the library loaded from the other install belongs to a different SDK release than the wrapper expects.

How do you remove every copy of the SDK in one pass?

Purge every package-manager copy, uninstall every source build from its own build directory, and remove every pip copy inside every environment — all three classes, in that order, or whichever copy survives keeps breaking the next install.

  1. Purge the Debian packages. On Debian or Ubuntu, list every installed package whose name contains the SDK name, then purge the whole list in one pass: dpkg -l | grep "sdk-name" | cut -d " " -f 3 | xargs sudo dpkg --purge. Replace "sdk-name" with your SDK's package name, and read the grep output before purging.
  2. Remove source builds where you built them. Change into the build directory of the source tree and run sudo make uninstall && make clean. A source install leaves no record in the package manager, so this is the only documented way to take one out.
  3. Remove the pip copies from every environment. In each conda environment and venv on the machine, run python -m pip uninstall with the wrapper's package name. Include the base environment; that copy hides most often.
  4. Confirm nothing survived. The grep in step 1 prints nothing, python -m pip list is clean in every environment, and no SDK files remain under /usr/local/lib.

How do you install one clean SDK that matches your interpreter?

Install exactly one build, made for the interpreter you script in: add the wrapper with python -m pip from inside that environment, or build the SDK from source once — on an ARM64 board that is usually the only documented option — so viewer and wrapper come from one tree.

  1. Create one environment with an explicit interpreter. conda create -n vis38 python=3.8 — vis38 is an example name, and putting the version in the name is the point — then activate it with conda activate vis38.
  2. Check the pairing before installing anything. python --version prints 3.8.x, and pip --version names this environment's interpreter. If they disagree, stop there.
  3. Install the wrapper into that environment. python -m pip install with the wrapper's package name. Never drop in a wheel downloaded by hand for another CPython.
  4. Prove the repair. Run the two-line import from the earlier section: __file__ now points inside this environment's site-packages, and the SDK's enumerate sample lists the camera. Open the viewer once more; it must still enumerate, from the same single install.

On ARM64 single-board computers, prebuilt wheels rarely exist for your exact interpreter, and the vendor's install guide for those boards builds the SDK from source with the Python wrapper enabled in the same pass — one build then serves the viewer, the tools and your script. Keep the SDK and the wrapper on one release number from then on: upgrade both together or neither.

What if the camera is still not found after the cleanup?

Then the fault has moved from software supply to the camera link itself: re-run enumeration from a plain terminal with every other program closed, and split what remains into device ownership and access rights — each has its own documented case.

Enumeration succeeds only under sudo. Your user lacks access to the device node. The camera's udev rule is missing or stale; Udev rules for USB cameras on Linux: fix permission denied gives the rule syntax and the reload procedure, after which the script runs as your own user again.

Enumeration fails while another program holds the stream, or after a script crashed mid-run. The device is owned, not missing. Close or clean up the holders as set out in Camera SDK says no device connected: another process owns it, and release the handles a killed script left behind the way camera handle cleanup after Python script errors describes.

Nothing enumerates anywhere, viewer included. Split hardware from software first: another port, another cable, straight into the host rather than through a hub. A USB camera not-detected checklist walks those port, cable and power tests step by step. If the hardware passes but the viewer stopped working after your cleanup, the purge removed the library the viewer linked against — reinstall once, from the single source you chose in the previous section.

The same viewer-works, tool-fails split exists on GigE systems under Windows tools; GigE camera works in the vendor viewer but not in MAX covers that branch.

How do you stop duplicate installs from coming back?

Give the SDK one owner and record the pair that works: the package manager or one source tree, never both; wrappers go in only with python -m pip from inside the target environment; and you write down the SDK release, interpreter version and OS release after every successful rebuild.

  • One package manager owns the SDK. Updates arrive from that manager alone. A hand-run install over it is how the second copy is born.
  • Name environments after the interpreter. vis38, vis39: a name that carries the version shows the mismatch before you install anything.
  • Everything through python -m pip, inside the environment you will actually run.
  • Re-run the two-line import after every operating-system update. It catches a moved library in seconds, before your production script does.
  • Keep the vendor's minimal enumerate sample next to your project. When a new symptom appears, run it before your application code. If it enumerates, the fault is in your code; if it fails, the fault is in the install.

When the environment is clean and enumeration still fails on a camera from an order of ours, send the SDK release, the interpreter version and the enumeration output through the contact page — that triple usually locates the fault in one reply. Related integration cases sit on the systems topic page.

Questions

Can the package-manager install and the pip wrapper coexist safely?

Yes, if the versions line up exactly: the wrapper's required SDK release matches the installed library, and the wheel's CPython tag matches the interpreter inside the environment. The risk is silent drift — an operating-system update moves the library and not the wheel, and the same no-device error returns months later. One owner is the durable arrangement.

Why does the same script work on one machine and fail on another?

Identical code does not mean identical SDK state. Compare three values on both machines: `python --version` inside the environment, `ldd --version` for the C library, and the wrapper's `__file__` path. One machine pointing at a source build and the other at a wheel explains behavior that looks like a camera fault and is not.

Is running the script with sudo a valid fix for a missing device?

No. Sudo is a diagnostic: if enumeration succeeds only as root, your user lacks access to the device node, and the repair is the camera's documented udev rule, installed and reloaded. Running production scripts as root hides the fault, breaks reproducibility and gives the process more power than the task needs.

Does the same duplicate-install fault hit C++ programs or ROS nodes?

Yes, because the mechanism is shared-library resolution. A C++ program linked against one SDK build while the package manager holds another produces the same enumeration failure, and a ROS node picks its library through the build system that compiled it. The cleanup is identical; the check differs — read the library paths from the running process or its build script instead of `__file__`.

Do I have to rebuild the SDK after every operating-system update?

Not after a package-manager install, because updates arrive from the same manager and stay consistent. A source build can break when an update moves glibc or the system Python a release level. If enumeration suddenly fails everywhere after an update, rebuild the SDK once from a clean tree so the viewer and the wrapper move together.