3

I am trying to use the VLC module for a python script. I have run pip install python-vlc

C:\Users\Me>pip install python-vlc
Requirement already satisfied: python-vlc in c:\python34\lib\site-packages

When I run 'import vlc' I get this error:

Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec  6 2015, 17:06:10) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vlc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\vlc.py", line 181, in <module>
    dll, plugin_path  = find_lib()
  File "C:\Python34\lib\vlc.py", line 159, in find_lib
    dll = ctypes.CDLL(p)
  File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
>>>

I have been trying to figure this out for the last couple hours, and am stumped. After searching through SO and Google for a while, I believe it has something to do with setting a PATH variable? But, I could be waaay off. Maybe I installed this wrong, or something, I don't know...

9
  • Did you compile VLC from source? Commented Apr 28, 2017 at 23:18
  • From github? no... Commented Apr 29, 2017 at 0:27
  • just uninstalled, and ran pip install git+https://git.videolan.org/git/vlc/bindings/python.git Commented Apr 29, 2017 at 0:34
  • You're running 64-bit Python, and find_lib() may have found a 32-bit VLC DLL. Commented Apr 29, 2017 at 0:36
  • 1
    Call find_lib and print the DLL path that it returns. Check to see if you can load the DLL via ctypes.CDLL in 32-bit Python. Commented Apr 29, 2017 at 1:02

1 Answer 1

4
  1. Uninstall your vlc
  2. Search 'libvlc.dll' on your local disk, and delete them all.
  3. Install vlc(x64) again, and note that don't install it under 'program files',
  4. Then it will work.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.