python vlc bindings for windows - windows

I am on Windows, and I wish to use Python Bindings for VLC. I've already downloaded the module from https://github.com/oaubert/python-vlc as per the instruction. But, still I can't import the module.
The error looks like this :
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
import vlc
File "c:\python27\python-vlc-1.1.2\vlc.py", line 173, in <module>
dll, plugin_path = find_lib()
File "c:\python27\python-vlc-1.1.2\vlc.py", line 150, in find_lib
dll = ctypes.CDLL('libvlc.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
My aim is to stream the openCV webcam video inside a wxPython window using vlc instance.

I solved the problem myself. I was trying to load a 32-bit dll from a 64-bit process, that's why it doesn't worked out. Finally I am able to fix it by using a 64-bit dll.

Related

compiling esp32 app with eclipse on windows 7: "make" not found

I'm trying to setup my first development for esp32 with eclipse on windows 7.
I installed esp-idf using esp-idf-tools-setup.exe installer which should install
everything needed.
I'm testing with the hello world example app from esp-idf. I can compile it using the python command line
idf.py build
But I need eclipse, it's a bit less obvious... I followed these instructions:
In this page, I can see that there's a need of msys. So I installed
msys2 64 bits.
I copied the xtensa-esp32-elf dir into the "msys64\var\opt" directory to match the PATH variable (and updated it based on the documentation)
Now, when compiling with eclipse, I got the following error:
Traceback (most recent call last):
File "C:/program/esp-idf/tools/windows/eclipse_make.py", line 36, in <module>
main()
File "C:/program/esp-idf/tools/windows/eclipse_make.py", line 29, in main
make = subprocess.Popen(["make"] + sys.argv[1:] + ["BATCH_BUILD=1"], stdout=subprocess.PIPE)
File "C:\python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] Le fichier spécifié est introuvable
Python make is unable to launch "make". The thing is I can't find a make exe anywhere...
This other page states that I must run
make menuconfig
before building with eclipse but, of course, this does not work better for the same reason...
What should I do?
Well, in windows you have nmake (IIRC installed with visual studio tools - or the free where vstools compiler pack). Or you can install something more like gnu-make from one of:
mingw32 : link
cygwin : link
msys2 : link
gnuwin32 : link
There are others as well. Some of these have make command (if you add the bin folder to your path) others will have things like mingw32-make which you may have to alias (I made a batch file called make.bat which just calls mingw32-make %*. But where ever you install make (and nmake IMHO is a really limited poor version of make) you need to add it to your windows path before you run your python script. So in short I think you are just missing a set of tools...
Another option is to just copy ...\MinGW\bin\mingw32-make.exe to ...\MinGW\bin\make.exe
I did add mys2 thinking it will contain everything needed.
In fact msys2 is delivered with a very minimal set of features. I had to install make using the msys2 package manager with the following command:
pacman -S make
Pretty simple when you know!
For esp-idf cmake projects, try this https://github.com/espressif/idf-eclipse-plugin

Setting up google assistant on windows PC

I followed instructions in the below link to set up google assistant in my Windows PC.
https://developers.google.com/assistant/sdk/guides/library/python/
But in the step while running the hotword command, i am getting the below error :
Traceback (most recent call last):
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\runpy.py",line 193, in
_run_module_as_main
"__main__", mod_spec)
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\310211247\AppData\Local\Continuum\miniconda3\Scripts\googlesamples-assistant-hotword.exe\__main__.py", line 5, in <module>
File "c:\users\310211247\appdata\local\continuum\miniconda3\lib\site-packages\googlesamples\assistant\library\hotword.py", line 27, in <module> from google.assistant.library import Assistant
ModuleNotFoundError: No module named 'google.assistant.library'
How can i resolve this error?
As noted in the Compatibility section for the library, it is only supported on linux-armv7l and linux-x86_64 architectures. The library is not expected to work on a Windows device. Instead, you should look at using the service API.
Google's recommendation is to use the assistant service:
The Google Assistant Library for Python is deprecated as of June 28th, 2019
You can configure the assistant following these instructions:
https://developers.google.com/assistant/sdk/guides/service/python/
After installation to get the hotword working you need to install the assistant library:
pip install google-assistant-library
Then you can run the google assistant with the hotword:
googlesamples-assistant-hotword --project-id project --device-model-id model

Using Docker and Compose in Hyper-V with Windows Server 2016

I currently have a Hyper-V Virtual machine whose guest OS is Microsoft Server 2016
I was able to install the Docker Service and use the command line to create a docker image
I would like to try the same process out in Visual Studio using compose, but it looks like that will only work if the ToolBox is installed. I installed the Toolbox and when I build I get an error around the volume spec, I believe this is because the target OS is Linux.
Since Windows Server 2016 is not compatible with Docker for Windows, is it the case that when targeting Windows Containers onc can only use the service + powerhsell, and if they want to use Compose in Visual Studio I would have to disable the hyper-visor internally and make sure the Linux VM is running?
I am a little confused on the workflow regarding windows server + VS with Docker. Thanks for any clarification.
EDIT:
I uninstalled the ToolBox to simplify the environment, I downloaded compose this way:
Invoke-WebRequest " https://github.com/docker/compose/releases/download/1.15.0-rc1/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe
And now the build error is:
ERROR: for dockercompose1517717654_azurecontainersite_1 __init__() got an
unexpected keyword argument 'cpu_count'
ERROR: for azurecontainersite __init__() got an unexpected keyword
argument 'cpu_count'
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\main.py", line 926, in up
File "compose\project.py", line 424, in up
File "compose\parallel.py", line 69, in parallel_execute
TypeError: __init__() got an unexpected keyword argument 'cpu_count'
Failed to execute script docker-compose.
At this time Visual Studio tools only support Linux Containers. If/when that changes I will update this answer.
Also to get VS with Compose to work on Server 2016, I installed the edge version of Docker for Windows with the following link:
https://store.docker.com/editions/community/docker-ce-desktop-windows

lldb python error

I tried running lldb on my mac and get this at startup:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/embedded_interpreter.py", line 1, in <module>
import readline
ImportError: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
I tried adding the environment variable VERSIONER_PYTHON_PREFER_32_BIT=yes but this error still appears. I'd reckon that the lldb is using a different python environment than it's Mac host so where do I make the change to make it use 32bit mode? thanks.
UPDATE:
I did an arch -i386 lldb and it works in 32-bit. To make it work in 64-bit, I installed a 64-bit version of python readline for OS X but got more problems with native python libraries such as termios and time. So I downloaded python 2.7.3 64-bit installer DMG file and installed its binary; now lldb works in 64 bit finally on my 10.8 mountain lion. Thanks.
It looks like you installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so at some point on your system (I don't see it on my Mac OS X 10.7.5 installation, although maybe it's included in 10.8), and that dylib is only built 32-bit. You can confirm with
file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
on your system. You could try to force lldb to also run in 32-bit mode (the distribution binary is built 32-/64- universal) but instead I would recommend removing that 32-bit-only readline.so from your system unless you really need it there.
For the sake of anyone else coming to this question looking for a quick fix - Linus Oleander's answer worked for me -- that is, run
pip install six
Hazarding a guess as to why this works, I think this smooths over some python incompatibility issues that lldb is facing when running on machines with a 'non-standard' python installation. This also works when using Homebrew's version of llvm.

Python Ctypes Load Library

I am using windows 7 64 bit machine. I installed Visual studio 2010 and developed a simple win32 dll to add 2 numbers.. The dll is created and i used a test application to test the dll and it works fine..
Now i write python script(shown below) to use this library. But i get the following error message.
Traceback (most recent call last):
File "C:\Users\sbritto\Documents\Visual Studio 2008\Projects\MathFuncsDll\Debug\MathFuncs.py", line 5, in <module>
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application
Python Script
import ctypes
from ctypes import *
#lib = cdll.LoadLibrary("MathFuncsDll.dll")
lib = ctypes.WinDLL('MathFuncsDll.dll',use_last_error=True)
print lib
Kindly let me know ASAP.
Thanks in advance
You'll get this error if you try to open a 64-bit DLL using a Python interpreter compiled for a 32-bit machine, or vice versa. So, if this is a 64-bit DLL you need to make sure you are running a 64-bit Python.

Resources