Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D435 "Import Error: DLL load failed: The Specified module could not be found" #1948

Closed
jasonjsong opened this issue Jun 25, 2018 · 14 comments
Closed
Assignees
Labels

Comments

@jasonjsong
Copy link

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model D435
Firmware Version 05.09.02.00
Operating System & Version Win 10
Platform PC
SDK Version 2.0
Language python
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

Hello all! I am trying to set up some code for my D435 Intel Realsense Camera, and have already installed the SDK as well as the GitHub librealsense folder. I have set the appropriate environmental variables (I believe), and after dragging the realsense dll file and the pyealsense2.pyd files into my project folder, as well as copying them into Python folder and setting the appropriate path variables, I am now met with the issue of "Import Error: DLL load failed: The Specified module could not be found". Any help would be greatly appreciated, thanks!

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @jasonjsong,

did you use the prebuild library from the Realsense SDK, rather than build it from source ?
if that is the case,
(1)Note that these binaries are built with Python 2.7, and cannot be import using Python 3)

(2) please check if either Miscrosoft Visual c++ 2015 Redistributable (X64) or Microsoft Visual c++2017 is installed on your PC, if no, please install either one
best
wwppyy

@LeMajors
Copy link

I have still the same problems (#1877 - unfortunately all hints doesn't work for me. Miscrosoft Visual c++ 2015 Redistributable (X64) is installed.)

You say, the binaries cannot import using Python 3 - @dorodnic said:

Hi @LeMajors
Can you try the files installed with Intel.RealSense.SDK.exe? Under C:\Program Files\Intel RealSense SDK 2.0\bin we provide x86 and x64 versions for both python 2.7 and 3.6.

At .../Intel RealSense SDK 2.0/bin/ I can find only /x64 and /x86 folders - I assume these are for python 2.7 and do not work for 3.6?

So there is no workaround and we have to build the library form source?

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors,

at https://github.com/IntelRealSense/librealsense/tree/development/wrappers/python
the latest windows installation session mentioned
"Windows users can install the RealSense SDK 2.0 from the release tab to get pre-compiled binaries of the wrapper, for both x86 and x64 architectures. (Note that these binaries are built with Python 2.7, and cannot be import using Python 3)"

by the way, on your setup, even with the VC++ redistributable (X64) is installed, using Python 2.7 still not able to import the pre-compiled library?
or you have to use python 3 for some reason?
if that the case, please see if there still issues when build the library from source
best

@LeMajors
Copy link

The D435 is part of a robot project that already has many thousands of lines of code. So I will not go back to 2.7.
As noob in terms of cmake I need some additional help.
What are the settings for cmake-gui (win10, 64Bit)?

  • Where is the source code: "C:/.../RealSense D435/librealsense-2.12.0/src" doesn't work. What's the correct path?
  • Where to build the binaries: I guess, it's up to me?
  • Where and how can I select the option "BUILD_PYTHON_BINDINGS"?

Kind regards, Marcus

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors
please find below for my inline comment
What are the settings for cmake-gui (win10, 64Bit)?

  • Where is the source code: "C:/.../RealSense D435/librealsense-2.12.0/src" doesn't work. What's the correct path?
    [ww]
    once you launch the cmake -gui
    you should set the where the source code to C:/.../RealSense D435/librealsense-2.12.0/ (go one upper layer)

  • Where to build the binaries: I guess, it's up to me?
    yes, it is up to you,
    ex :C:/.../RealSense D435/librealsense-2.12.0/build/, the CMAKE will create the folder for you if not exist

  • Where and how can I select the option "BUILD_PYTHON_BINDINGS"?
    once you set the directory right, the CMAKE will pop up the options list
    then you need to check the BUILD_PYTHON_BINDINGS option

once checked, press configure button
and ensure the PYTHON EXCUTABLE is set to Python 3

ex :C:/Users/wangwill/AppData/Local/Programs/Python/Python36/python.exe

press generate button to generate the solution once completed you can press open project to launch the solution then build the library or sample code

under the build/release or build/debug folder, you should able to find realsense.dll and pyrealsense2.cp36-win_amd64.pyd which you need
you can copy both under C:\xxx\librealsensexxx\wrappers\python\examples\ and run the sample code to see if it work ex. python-tutorial-1-depth.py

@LeMajors
Copy link

LeMajors commented Jun 28, 2018

Hi @RealSense-Customer-Engineering
thanks for your detailed informations.

Yes it's Win10, 64Bit, Intel Celeron CPU N3450.

ensure the PYTHON EXCUTABLE is set to Python 3

When I doublecklick on any python-file it's interpreted by Python 3, so the environment pathes should be ok.

When I set the two paths, there is no popup. Now I can just Add an Cache Entry (Name, Type, Value, Description) and Configure:
unbenannt
I tried all 3 choices "Visual Studio 15 2017", "Visual Studio 15 2017 Win64" , "Visual Studio 15 2017 ARM". All with this result:
Error in configuration process, project files may be invalid
The CMakeOutput.log says: "The system is: Windows - 10.0.17134 - AMD64" - but that's definitely not the case!?
What's wrong here?

Regards, Marcus

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors,
please check if you see files such as
CMakeLists.txt , CONTRIBUTING.md, AUTHORS ...
folders such as \src, \CMake, \examples\ ...
are under C:/.../RealSense D435/librealsense-2.12.0/ folder

the CMAKE gui need to access the CMakeLists.txt to import the options

please check if there is additional folder layer such as

C:/.../RealSense D435/librealsense-2.12.0/ librealsense
if that is the case you will need to change source dir to C:/.../RealSense D435/librealsense-2.12.0/librealsense
that the CMAKE be able to find the CMakelist.txt
and it should always good that the full path is not too long C:/.../.........../........../RealSense D435/librealsense-2.12.0/librealsense

@LeMajors
Copy link

Hi @RealSense-Customer-Engineering
Yes, the files and folders are existing.
I also copied the folder to c:/ to shorten the path. To be sure I gave "everybody" full access to all files and folders. But It's the same result.
unbenannt

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors
if you start from scratch
after you set the source and build folder
the cmake will ask you to set the compiler ex VS15 2017 X64 (depend on which VSc++ compiler you install on your PC)
then you need to press the configure button to pop up the option list.
would suggest you to have clean source code the do the CMake

you should see something like below when you press configure button

The CXX compiler identification is MSVC 19.14.26430.0
The C compiler identification is MSVC 19.14.26430.0
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Info: REALSENSE_VERSION_STRING=2.13.0
Performing Test COMPILER_SUPPORTS_CXX11
Performing Test COMPILER_SUPPORTS_CXX11 - Success
Performing Test COMPILER_SUPPORTS_CXX0X
Performing Test COMPILER_SUPPORTS_CXX0X - Failed
Found OpenGL: opengl32
Configuring done

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors
please refer to below link for the Windows librealsense installation guide which has pictures which is easier to follow
https://github.com/IntelRealSense/librealsense/blob/development/doc/installation_windows.md

@LeMajors
Copy link

Ok, I came a little further...
After not seeing any options as in the screenshot, I reinstalled CMake.
Also I checked the properties of "CMakeLists.txt" - Windows said, it may be blocked because it comes from a different computer... I switched to "allow".
I guess, this was the main problem. Now he finds CMakeLists.txt because of this Error:

Generator
Visual Studio 15 2017 Win64 could not find any instance of Visual Studio.

So I reinstalled, but with no success. What I have installed is "Microsoft Visual C++ 2017 Redistributable (x64) - 14.14.26429".
Do I have to install something different?

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
Hi @LeMajors
it looks something wrong about your VC installation
please find below link which has similar issue as you

ycm-core/YouCompleteMe#2945

The VC folder should be there. Are you sure you selected Desktop development with C++ in the Workloadstab during installation of Visual Studio 2017? Run again the vs_Community.exe installer, click Continue, wait for the products screen to appear, click on Modify under Visual Studio Community 2017, and check if Desktop development with C++ is selected under Windows. If not, select it then click on the Modify button to install it. Once it's done, leave the installer and run again the install.py script.

and do you mean i need to install vs2015 or vs 2013?

No, it should work fine with VS 2017.

weikent commented on Mar 12

It worked. Thank you for your help.
It is my fault, I don't select Desktop development with C++

@LeMajors
Copy link

LeMajors commented Jun 30, 2018

@RealSense-Customer-Engineering - Thank you for the help and your patience! It's working!!! :-D

To summarize the problems:

  • I had to allow access to the file "CMakeLists.txt" because it came from another computer.
  • The "Visual Studio Community 2017" has to be installed. (I assumed that the installation from "Microsoft Visual C ++ 2017 Redistributable (x64) - 14.14.26429" would be enough.)

So for me everything is fine now. If it's also working for @jasonjsong we can now close this issue.

@jasonjsong
Copy link
Author

Working for me as well now!

My primary issue was installing Visual Studio Community 2017, thanks for all the help everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants