Giter Club home page Giter Club logo

Comments (5)

mnakazawa avatar mnakazawa commented on July 28, 2024 3

Hi.
I just started using pyrealsense, and faced the same issue on a similar environment (Win10, RealSense R200, Anaconda 3.6, librealsense1.21, pyrealsense2.2, etc.).
I checked pyrealsense/extlib.py causing warnings, then I found pyrealsense was missing realsense.dll.

So I simply set environment variable PATH to a directory including realsense.dll.
Now it seems to work well.
I hope this will help you.

from pyrealsense.

jynah92 avatar jynah92 commented on July 28, 2024 1

Thank you all!! It works!

from pyrealsense.

toinsson avatar toinsson commented on July 28, 2024

any progress?
If you found the issue, please share it and close the issue.

from pyrealsense.

jynah92 avatar jynah92 commented on July 28, 2024

No, I haven't.. Have you any solutions..?

from pyrealsense.

toinsson avatar toinsson commented on July 28, 2024

it looks like you cannot find the compiled library on your path.
There is a warning issued in the file extlib.py at line 26.

If you want to debug manually, you could run the code in a ipython shell and execute:

import sys
import warnings
import ctypes

os_name = sys.platform
lrs_prefix_mapping = {'darwin': 'lib', 'linux': 'lib', 'linux2': 'lib', 'win32': ''}
lrs_suffix_mapping = {'darwin': '.dylib', 'linux': '.so', 'linux2': '.so', 'win32': '.dll'}

try:
    lrs_prefix = lrs_prefix_mapping[os_name]
    lrs_suffix = lrs_suffix_mapping[os_name]
except KeyError:
    raise OSError('OS not supported.')


## import C lib
try:
    lrs = ctypes.CDLL(lrs_prefix+'realsense'+lrs_suffix)
import ctypes
import sys
import os
import warnings

os_name = sys.platform
lrs_prefix_mapping = {'darwin': 'lib', 'linux': 'lib', 'linux2': 'lib', 'win32': ''}
lrs_suffix_mapping = {'darwin': '.dylib', 'linux': '.so', 'linux2': '.so', 'win32': '.dll'}

try:
    lrs_prefix = lrs_prefix_mapping[os_name]
    lrs_suffix = lrs_suffix_mapping[os_name]
except KeyError:
    raise OSError('OS not supported.')


## import C lib
try:
    lrs = ctypes.CDLL(lrs_prefix+'realsense'+lrs_suffix)
except OSError:
    warnings.warn("librealsense not found.")
    lrs = None

On my machine, if I check the object lrs I get:
In [7]: lrs
Out[7]: <CDLL 'librealsense.dylib', handle 1048e5f80 at 0x106370320>

Another way to debug would be to check the path variable in your environment.
In the ipython shell:

import os
print(os.environ['PATH'])

This should include the path that contains the library.

from pyrealsense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.