oaubert / python-vlc

Python vlc bindings
GNU Lesser General Public License v2.1
388 stars 111 forks source link

FileNotFoundError error message thrown: When attempt to play an mp3 stream via URL #201

Open synco1111 opened 2 years ago

synco1111 commented 2 years ago
Environment:
IDE - VsCode
Python venv version - 3.9.7 64-bit
vlc locally installed version - 3.0.16
python-vlc version - latest

When attempt to play a audio stream as appear below I keep get the following error:

Code

station_url = response ['results'][0]['u']
p = vlc.MediaPlayer(station_url)
p.play()

Error

Traceback (most recent call last):
  File "c:\Daniel\Projects\Python\Sandbox\radio_stations_api.py", line 4, in <module>
    import vlc
  File "c:\Daniel\Projects\Python\Sandbox\.venv\lib\site-packages\vlc.py", line 210, in <module>
    dll, plugin_path  = find_lib()
  File "c:\Daniel\Projects\Python\Sandbox\.venv\lib\site-packages\vlc.py", line 170, in find_lib
    dll = ctypes.CDLL('.\\' + libname)
  File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Daniel\Projects\Python\Sandbox\libvlc.dll' (or one of its dependencies). Try using 
the full path with constructor syntax.