ndi-python
ndi-python copied to clipboard
Unable to import loaded module.
I compiled the module successfuly but attempting to load it while in the same directory as the so fields yields the below error.
Traceback (most recent call last):
File "input.py", line 3, in <module>
import NDIlib as ndi
ModuleNotFoundError: No module named 'NDIlib'
@medcelerate What OS are you using? In windows, you needs to copy the following libraries to execute directory.
NDIlib.cp**-win_amd64.pyd
Processing.NDI.Lib.x64.dll
In macOS,
NDIlib.cpython-**m-darwin.so
libndi.4.dylib
Are these files generated upon build?
Let me try copying the Dylib to the folder. I need to see the exact file generated but it is and NDIlib*.so file
On Thu, May 14, 2020 at 8:49 AM Joel L B [email protected] wrote:
Are these files generated upon build?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/buresu/ndi-python/issues/1#issuecomment-628611606, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYKRGJQX7FCP2CROXEXHQ3RRPSFDANCNFSM4M7AARAQ .
Interesting, I seem to be missing some files then. I'm building with NDI 4.5 SDK. Is this the right SDK version to be using? or was this made for NDI 3.x?
Did anyone find a solution?
Unfortunately I haven’t yet.
On Sun, Jun 14, 2020 at 3:56 PM pasanm2 [email protected] wrote:
Did anyone find a solution?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/buresu/ndi-python/issues/1#issuecomment-643814395, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYKRGNO2WWOUJTUABH3MODRWUTNBANCNFSM4M7AARAQ .
I didn't either. I had success with pyNDI
Thanks for the suggestion. Will give it a try!
Got examples to work with NDI SDK 4.5 (latest) installed on Ubuntu 20.4, just moved the built file NDIlib.cpython-38-x86_64-linux-gnu.so into the examples folder. Should be possible to install the lib to Python site-packages but I'm unsure how at the moment. Simpler solutions to access the lib is by setting up a custom folder wherein you put a symlink to the built lib file I mentioned, following the steps here: https://askubuntu.com/a/250935 (Linux OS only).
On Windows, I cannot find "Processing.NDI.Lib.x64.dll" after build process.
mkdir build
cd build
cmake ..
cmake --build . --config Release
After this, files I see in Release directory are following 3, not including the "Processing..." file.
NDIlib.cp38-win_amd64.pyd NDIlib.exp NDIlib.lib
On Windows, I cannot find "Processing.NDI.Lib.x64.dll" after build process.
mkdir build
cd build
cmake ..
cmake --build . --config Release
After this, files I see in Release directory are following 3, not including the "Processing..." file.
NDIlib.cp38-win_amd64.pyd NDIlib.exp NDIlib.lib
On windows the Processing.NDI.Lib.x64.dll
is located at
C:\Program Files\NDI\NDI 5 SDK\Bin\x64
after installing NDI 5 SDK
from https://www.ndi.tv/sdk/
copy Processing.NDI.Lib.x64.dll
to your example folder and you will be good to go!
I've exactly did what you say but nothings happens. Also my files don't have .dll extension but only .lib.
Does someone know a way to import NDI module correctly?
I've exactly did what you say but nothings happens. Also my files don't have .dll extension but only .lib.
Does someone know a way to import NDI module correctly?
Sorry the dll is located at C:\Program Files\NDI\NDI 5 SDK\Bin\x64
( I corrected the original reply above)
Sorry for late reply. ndi-python support pypi repository now. Please try to install it from pip.
pip install ndi-python
Solved this issue on Ubuntu 20 and NDI 5 SDK as follows:
You just need to set LD_LIBRARY_PATH to include the folder in which the shared libraries are present. For me, sourcing the lib.linux-x86_64-3.8 inside the build folder solved the error.
Eg: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ndi-python/build/lib.linux-x86_64-3.8/NDIlib:$LD_LIBRARY_PATH
Hello,
I have difficulties running the examples on macos (Apple Silicon chip):
![Screenshot 2022-05-20 at 23 10 25](https://user-images.githubusercontent.com/15997013/169610945-c9dc4827-aa4a-4b28-91ea-8dd969bbe993.png)
I followed these steps:
![Screenshot 2022-05-20 at 23 07 58](https://user-images.githubusercontent.com/15997013/169610989-5184dad9-b5f8-4ed1-b07d-829fda104b8a.png)
And here is the output (seems to work):
![Screenshot 2022-05-20 at 23 09 03](https://user-images.githubusercontent.com/15997013/169611071-c78743af-e13e-4e0f-bdb5-91b4599f8727.png)
Then I copied the files that were created in the examples directory:
![Screenshot 2022-05-20 at 23 08 16](https://user-images.githubusercontent.com/15997013/169611149-c00fd265-8f58-444f-aaaf-b8da9a4e81e2.png)
But this still doesn't work... Am I missing something?
Thank you,
Rayan
Edit: I should add that with pip it does not work either and I obtain the error below
@rayandaod Hi I have tried to support arm cross-compilation on mac with the latest build 4117651c8aeef18ee2cce7dfe90269841edbdb29. Please pull the latest changes and rebuild.
git pull
git clean -fdx
python setup.py build
and check the supported architectures.
file NDIlib.cpython-37m-darwin.so
If you get the following output, you have cross-compiled binary.
NDIlib.cpython-37m-darwin.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
NDIlib.cpython-37m-darwin.so (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
NDIlib.cpython-37m-darwin.so (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
Unfortunately I don't have an m1 mac so I can't confirm it works :( And pip binary is only supported for x86_64 now.
I uploaded cross-compiled binary to pypi. Please try to run pip install again.
pip install ndi-python --force
Hello @buresu!
Thank you for your answer.
I have done what you suggested and I indeed obtain the expected output:
NDIlib.cpython-37m-darwin.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64] NDIlib.cpython-37m-darwin.so (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 NDIlib.cpython-37m-darwin.so (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
Unfortunately, I still can't run the example scripts (No module named 'NDIlib' error remains)... Am I adding the right files to the examples folder (cf screen capture previously sent)?
I also tried with pip again by removing the cache and running the command you sent, but the result is the same as before.
Thank you, Rayan
I have finally managed to make it work by running the scripts with /opt/homebrew/bin/python3
instead of usr/bin/python3
😅 I guess I wasn't using the right python installation.
Thank you for your help!
@rayandaod Thank you for trying. I'm glad you were able to solve it!
I am on a Macbook Pro M1, installed ndi-python sucessfully from PyPi and NDI SDK 5 from NDI's official installer. Still, upon running the Python example scripts, I get this error:
import NDIlib as ndi
ModuleNotFoundError: No module named 'NDIlib'
What am I doing wrong?
I am still unable to run any of the examples on Windows... same error, even after copying the suggested dll to the examples folder "Processing.NDI.Lib.x64.dll" still the same error:
``ModuleNotFoundError: No module named 'NDIlib.NDIlib'
Even trying with different version of Python but no luck... same error every time.
Any workaround?
I am still unable to run any of the examples on Windows... same error, even after copying the suggested dll to the examples folder "Processing.NDI.Lib.x64.dll" still the same error:
``ModuleNotFoundError: No module named 'NDIlib.NDIlib'
Even trying with different version of Python but no luck... same error every time.
Any workaround?
Experiencing the same issues. I was able to compile it from source and I assume I have all files needed accessible in PATH
NDI SDK also installed properly.