# Error occurred while running psychopy code in spyder

**URL:** https://discourse.psychopy.org/t/error-occurred-while-running-psychopy-code-in-spyder/11360
**Category:** Other
**Tags:** spyder, anaconda
**Created:** [March 6, 2020, 8:56pm UTC](https://discourse.psychopy.org/t/error-occurred-while-running-psychopy-code-in-spyder/11360 "2020-03-06T20:56:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![XYan](https://avatars.discourse-cdn.com/v4/letter/x/ea666f/32.png) [@XYan](https://discourse.psychopy.org/u/XYan)
#### Post date: [March 6, 2020, 8:56pm UTC](https://discourse.psychopy.org/t/error-occurred-while-running-psychopy-code-in-spyder/11360/1 "2020-03-06T20:56:22Z")

</div>

Hello,

Python version: 2.7 (spyder, anaconda2)  
psychopy: StandalonePsychoPy2-1.90.3-win32

I want to use psychopy to trigger the EEG using parallel port.

My code can be run in the standalone Psychopy without error, and I can see markers in the EEG data.  
Since I use python directly to trigger another device, I tried to run psychopy in spyder after executing the following command in Anaconda prompt:

```auto
conda install wxpython
pip install pyglet psychopy

```

I didn’t come across problems while importing psychopy modules. However, error occurred when the code was being executed, and the error is like this:

```auto
runfile('C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py', wdir='C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32')
Could not import DLportIO driver, parallel Ports not available
Traceback (most recent call last):

  File "<ipython-input-6-4e011ca13845>", line 1, in <module>
    runfile('C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py', wdir='C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32')

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 95, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py", line 17, in <module>
    port = parallel.ParallelPort(address=0x0378)

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\psychopy\parallel\_dlportio.py", line 77, in __init__
    raise e

WindowsError: [Error 126] The specified module could not be found

```

Since the device is old and can only be triggered using python 2.7, does anyone know how to solve this?

---

<div class="post-metadata">

### Author: ![jtseng](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jtseng/32/32082_2.png) [@jtseng](https://discourse.psychopy.org/u/jtseng)
#### Post date: [April 13, 2020, 7:17pm UTC](https://discourse.psychopy.org/t/error-occurred-while-running-psychopy-code-in-spyder/11360/2 "2020-04-13T19:17:48Z")

</div>

Hi - I’m assuming that since your code works in PsychoPy, you definitely do have the DLportIO driver already installed. Is Spyder/Anaconda2 the 32-bit distribution? Sometimes errors come up with mismatches here.
