Vlc python broken on PyCharm 2019

Greetings. Does anyone know how to run python vlc on PyCharm 2019? The 2018 version worked as it should, but the new version says the following error:
Traceback (most recent call last):
   File "I: python kody / bordel / mp3.py", line 3, in <module>
     import vlc
   File "C: Users AppData Roaming Python Python37" site-packages vlc.py ", line 207, in <module>
     dll, plugin_path = find_lib ()
   File "C: Users' AppData Roaming Python Python37" site-packages vlc.py ", line 163, in find_lib
     dll = ctypes.CDLL (libname)
   File "C: Program Files Python37 libtypes \ __ init__.py", line 356, in __init__
     self._handle = _dlopen (self._name, mode)
OSError: [WinError 126] The specified module could not be found
Thanks for the advice.
 
10 comments
Comment actions Permalink

Hi,

What interpreter are you using? Please try running your code from the system terminal, using the same interpreter and environment, to identify if the issue is IDE-related. If confirmed, we can look closer.

0
Comment actions Permalink
Greetings.
   
I tried it through PowerShell and there it worked normally.
The
whole program ran without error.
 
0
Comment actions Permalink

Please run the following script both in your terminal (Powershell) and from PyCharm, and provide outputs for comparison.

import sys
import os
import pkg_resources
from pprint import pprint

pprint({
'sys.version_info': sys.version_info,
'sys.prefix': sys.prefix,
'sys.executable': sys.executable,
'sys.path': sys.path,
'pkg_resources.working_set': list(pkg_resources.working_set),
'PATH': os.environ['PATH'].split(os.pathsep),
})
0
Comment actions Permalink

Greetings.

Here is a listing of powershel:

PS I:\python kody\Notebook> python eroro.py
{'PATH': ['C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath',
          'C:\\Program Files\\Python37\\Scripts\\',
          'C:\\Program Files\\Python37\\',
          'C:\\Windows\\system32',
          'C:\\Windows',
          'C:\\Windows\\System32\\Wbem',
          'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\',
          'C:\\Windows\\System32\\OpenSSH\\',
          'C:\\Program Files (x86)\\Windows Live\\Shared',
          'C:\\Users\\tucky\\AppData\\Local\\Microsoft\\WindowsApps',
          '',
          'C:\\Program Files\\JetBrains\\PyCharm Community Edition '
          '2018.3.5\\bin',
          '',
          'C:\\Program Files\\Bandizip\\'],
 'pkg_resources.working_set': [python-vlc 3.0.6109 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               pyglet 1.3.2 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               pip 19.1.1 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               jsonpickle 1.2 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               future 0.17.1 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               tkfontchooser 2.0.2 (c:\program files\python37\lib\site-packages),
                               setuptools 40.8.0 (c:\program files\python37\lib\site-packages)],
 'sys.executable': 'C:\\Program Files\\Python37\\python.exe',
 'sys.path': ['I:\\python kody\\Notebook',
              'C:\\Program Files\\Python37\\python37.zip',
              'C:\\Program Files\\Python37\\DLLs',
              'C:\\Program Files\\Python37\\lib',
              'C:\\Program Files\\Python37',
              'C:\\Users\\tucky\\AppData\\Roaming\\Python\\Python37\\site-packages',
              'C:\\Program Files\\Python37\\lib\\site-packages'],
 'sys.prefix': 'C:\\Program Files\\Python37',
 'sys.version_info': sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)}
PS I:\python kody\Notebook>

Here is a PyCharm listing:

"C:\Program Files\Python37\python.exe" "I:/python kody/Notebook/eroro.py"
{'PATH': ['C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath',
          'C:\\Program Files\\Python37\\Scripts\\',
          'C:\\Program Files\\Python37\\',
          'C:\\Windows\\system32',
          'C:\\Windows',
          'C:\\Windows\\System32\\Wbem',
          'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\',
          'C:\\Windows\\System32\\OpenSSH\\',
          'C:\\Program Files (x86)\\Windows Live\\Shared',
          'C:\\Users\\tucky\\AppData\\Local\\Microsoft\\WindowsApps',
          '',
          'C:\\Program Files\\JetBrains\\PyCharm Community Edition '
          '2018.3.5\\bin',
          '',
          'C:\\Program Files\\Bandizip\\'],
 'pkg_resources.working_set': [python-vlc 3.0.6109 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               pyglet 1.3.2 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               pip 19.1.1 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               jsonpickle 1.2 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               future 0.17.1 (c:\users\tucky\appdata\roaming\python\python37\site-packages),
                               tkfontchooser 2.0.2 (c:\program files\python37\lib\site-packages),
                               setuptools 40.8.0 (c:\program files\python37\lib\site-packages)],
 'sys.executable': 'C:\\Program Files\\Python37\\python.exe',
 'sys.path': ['I:\\python kody\\Notebook',
              'I:\\python kody',
              'C:\\Program Files\\Python37\\python37.zip',
              'C:\\Program Files\\Python37\\DLLs',
              'C:\\Program Files\\Python37\\lib',
              'C:\\Program Files\\Python37',
              'C:\\Users\\tucky\\AppData\\Roaming\\Python\\Python37\\site-packages',
              'C:\\Program Files\\Python37\\lib\\site-packages'],
 'sys.prefix': 'C:\\Program Files\\Python37',
 'sys.version_info': sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)}
Process finished with exit code 0
0
Comment actions Permalink

Thanks. 

I could also reproduce the issue by installing python-vlc library and doing `import vlc`, however the issue is reproduced from system terminal too.

Can you please provide screenshots demonstrating that you can run python shell in your powershell terminal and running the following commands interactively?:

 

>>> import sys

>>> import vlc

>>> print(sys.executable)

0
Comment actions Permalink

Sorry for the delayed reply. I must say I'm baffled by the issue, and I was out of ideas, but now I want to get back to it, if it's still relevant for you. The interpreters look almost identical from command line and from PyCharm, but behave differently.

But looking at the outputs again, in PyCharm you have one extra entry in your sys.path: "I:/python cody"

Is this your project root?

0
Comment actions Permalink

I: Python codes is the original directory where I created projects. It was originally on C: but before I reinstalled the system, I'd rather back it up to another disk. Unfortunately, even before installing the system, PyCharm 2019 VLC didn't work for me. The VLC version of PyCharm 2018 goes just fine now.

0
Comment actions Permalink

I've tried the same commands in PyCharm 2018.3 and here's the result.

C:\Users\tucky\Desktop\Notebook>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> import pkg_resources
>>> from pprint import pprint
>>> pprint({ 'sys.version_info': sys.version_info, 'sys.prefix': sys.prefix, 'sys.ex
ecutable': sys.executable, 'sys.path': sys.path, 'pkg_resources.working_set': list(pkg_
resources.working_set), 'PATH': os.environ['PATH'].split(os.pathsep),})
{'PATH': ['C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath',
'C:\\Program Files\\Python37\\Scripts\\',
'C:\\Program Files\\Python37\\',
'C:\\Windows\\system32',
'C:\\Windows',
'C:\\Windows\\System32\\Wbem',
'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\',
'C:\\Windows\\System32\\OpenSSH\\',
'C:\\Program Files (x86)\\Windows Live\\Shared',
'C:\\Users\\tucky\\AppData\\Local\\Microsoft\\WindowsApps',
'',
'C:\\Program Files\\JetBrains\\PyCharm Community Edition '
'2018.3.5\\bin',
'',
'C:\\Program Files\\Bandizip\\'],
'pkg_resources.working_set': [python-vlc 3.0.6109 (c:\users\tucky\appdata\roaming\python\pyt
hon37\site-packages),
pyglet 1.3.2 (c:\users\tucky\appdata\roaming\python\python37\s
ite-packages),
pip 19.1.1 (c:\users\tucky\appdata\roaming\python\python37\sit
e-packages),
jsonpickle 1.2 (c:\users\tucky\appdata\roaming\python\python37
\site-packages),
future 0.17.1 (c:\users\tucky\appdata\roaming\python\python37\
site-packages),
tkfontchooser 2.0.2 (c:\program files\python37\lib\site-packag
es),
setuptools 40.8.0 (c:\program files\python37\lib\site-packages
)],
'sys.executable': 'C:\\Program Files\\Python37\\python.exe',
'sys.path': ['',
'C:\\Program Files\\Python37\\python37.zip',
'C:\\Program Files\\Python37\\DLLs',
'C:\\Program Files\\Python37\\lib',
'C:\\Program Files\\Python37',
'C:\\Users\\tucky\\AppData\\Roaming\\Python\\Python37\\site-packages',
'C:\\Program Files\\Python37\\lib\\site-packages'],
'sys.prefix': 'C:\\Program Files\\Python37',
'sys.version_info': sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial
=0)}

This is PyCharm 2019

Microsoft Windows [Version 10.0.18362.239]
(c) 2019 Microsoft Corporation. Všechna práva vyhrazena.

C:\Users\tucky\Desktop\Notebook>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> import pkg_resources
>>> from pprint import pprint
>>> pprint({ 'sys.version_info': sys.version_info, 'sys.prefix': sys.prefix, 'sys.executable':
sys.executable, 'sys.path': sys.path, 'pkg_resources.working_set': list(pkg_resources.working_se
t), 'PATH': os.environ['PATH'].split(os.pathsep),})
{'PATH': ['C:\\Program Files\\JetBrains\\PyCharm Community Edition '
'2019.1.2\\jbr\\\\bin',
'C:\\Program Files\\JetBrains\\PyCharm Community Edition '
'2019.1.2\\jbr\\\\bin\\server',
'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath',
'C:\\Program Files\\Python37\\Scripts\\',
'C:\\Program Files\\Python37\\',
'C:\\Windows\\system32',
'C:\\Windows',
'C:\\Windows\\System32\\Wbem',
'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\',
'C:\\Windows\\System32\\OpenSSH\\',
'C:\\Program Files (x86)\\Windows Live\\Shared',
'C:\\Users\\tucky\\AppData\\Local\\Microsoft\\WindowsApps',
'',
'C:\\Program Files\\JetBrains\\PyCharm Community Edition '
'2018.3.5\\bin',
'',
'C:\\Program Files\\Bandizip\\'],
'pkg_resources.working_set': [python-vlc 3.0.6109 (c:\users\tucky\appdata\roaming\python\python37\site
-packages),
pyglet 1.3.2 (c:\users\tucky\appdata\roaming\python\python37\site-packag
es),
pip 19.1.1 (c:\users\tucky\appdata\roaming\python\python37\site-packages
),
jsonpickle 1.2 (c:\users\tucky\appdata\roaming\python\python37\site-pack
ages),
future 0.17.1 (c:\users\tucky\appdata\roaming\python\python37\site-packa
ges),
tkfontchooser 2.0.2 (c:\program files\python37\lib\site-packages),
setuptools 40.8.0 (c:\program files\python37\lib\site-packages)],
'sys.executable': 'C:\\Program Files\\Python37\\python.exe',
'sys.path': ['',
'C:\\Program Files\\Python37\\python37.zip',
'C:\\Program Files\\Python37\\DLLs',
'C:\\Program Files\\Python37\\lib',
'C:\\Program Files\\Python37',
'C:\\Users\\tucky\\AppData\\Roaming\\Python\\Python37\\site-packages',
'C:\\Program Files\\Python37\\lib\\site-packages'],
'sys.prefix': 'C:\\Program Files\\Python37',
'sys.version_info': sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)}
>>>

0
Comment actions Permalink

Hi,

Ok, after some searching I've found what I think is a related issue: https://youtrack.jetbrains.com/issue/PY-34978

Particularly this comment reproduces the same error: https://youtrack.jetbrains.com/issue/PY-34978#focus=streamItem-27-3485617.0-0

According to the outputs, you're using PyCharm 2019.1.x. Have you already tried updating to 2019.2? The issue should be fixed there, please try and let me know.

0

Please sign in to leave a comment.