No module named vlc

I’ve written an experiment that plays several videos while awaiting key and mouse presses. I used the demo code MovieStim2TimingTest.py as the basis for my code. It loaded and ran fine on my developmental machine which is a Dell Optiplex 7020 Windows 7 64bit system with 8Gig of Ram and running Psychopy build v1.82.01. The problems started when I tried to run the same code on other machines. I can’t seem to get it to work on anything from a win 10 laptop to a Win 7 32bit machine with various versions of Psychopy each seeming to produce slightly different errors.

I then decided to get a setup as close to the developmental machine as possible. This is running on a Dell Optiplex 7020 Windows 7 64 bit with 8 Gib Ram but running Psychopy build v1.90.3.
One problem now is the call mouse.setSystemCursorVisibility(False); threw an exception because the setSystemCursorVisibility() method wasn’t present in the mouse object. The previous calls below generated no error:
io=launchHubServer();
mouse=io.devices.mouse;

I removed the mouse.setSystemCursorVisibility(False) line for the moment and the program moved on but now gets stuck at the video end of things and I receive a ‘No module named vlc’ error.

The MovieStim2TimingTest.py demo which runs fine on my development machine produces the same ‘No module named vlc’ on the near identical system. vcl.py are located in different parts of the system but I assume the different versions would find it.

Is there something simple thing I’m missing out here?

Maurice.

You need to install VLC separately.
Go to Videolan.org to download it and install it on your machine. Make sure you get the 64-bit version if you’re running a 64-bit PsychoPy installation.

If you’re running 32-bit PsychoPy, install the 32-bit version.

I almost forgot. You also need install the python-vlc module. From the command line:

pip install python-vlc

Hi tjwilli58.

I’ve done as suggested which has solved one problem but produced another. It now crashes in the movie2.py module at the end of the segment below. I’ve installed the 32 bit version of Psychopy along with a 32 bit version of vlc. The code segment doesn’t seem to get past the architecture issue to I’m at a loss here.

Any ideas?

try:
import vlc
except Exception as err:
if sys.maxsize == 9223372036854775807:
bits = 64
else:
bits = 32
if “wrong architecture” in err.message:
raise OSError(“Failed to import vlc module for MovieStim2.\n”
“You’re using %i-bit python. Is your VLC install the same?” % bits)
else:
raise err

@m_douglas, what happens if you just try to import vlc from a python prompt? I’m not familiar with the standalone PsychoPy, but installing under a conda environment, I just put all of the DLL files from vlc in the Library/bin folder.

You did do a
pip install python-vlc
correct?

Hi tjwili58.

Yes, I did do the ‘pip install python-vlc’ which went fine and produced no errors.

I’ve just tried the command line option with the result below.

C:\Users\mdoug009>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (
Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import vlc
Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\vlc.py”, line 203, in

dll, plugin_path = find_lib()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\vlc.py”, line 173, in
find_lib
dll = ctypes.CDLL(libname)
File “C:\Program Files (x86)\PsychoPy2\lib\ctypes_init_.py”, line 365, in _
init_
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

@m_douglas,
So it looks like you are using the standalone PsychoPy2, and also 32-bit Python 2.7. This might be better answered by one of the psychopy developers. I’m just another user.

One last thing I would suggest is to check your environment to make sure that the location of the vlc DLLs are in your PATH.

I’m going to be offline most of the day today, so I hope someone else can help. Good luck

Standalone psychopy on windows is still using 32bit python, because then it runs on all windows machines rather than us having lots of additional installations. Unfortunately that means you need 32 bit vlc as well (even if youre on a 64 bit windows installation).

Alternatively, have you tried using MovieStim3 instead?

@m_douglas,
Have you checked if
C:\Program Files (x86)\VideoLAN\VLC
is in your PATH environment variable?

HI Jon.

Yes, I uninstalled the 64 before installing the 32 bit version of VLC. I also included the path the videolan folder. I’m at a loss as to why the system ran well on my initial machine and am having such a problem with this and other machines. Is it worth me making a copy of the psychpy2 folder from the working machine and replacing over this problematic machine?

From your error message it looks like you’re using standalone psychopy, and vlc.y is being found. The thing that is not being found, or is the wrong architecture, is the vlc.exe file. I don’t think copying PsychoPy from a different machine will fix that (because the vlc installation won’t change)

I’m really not sure what happened there but I reinstalled using the file ‘vlc-3.0.6-win32’ I previously downloaded and it worked.

Much thanks.

hey i got same error can you please help me with this, i really need it to my project submission