psychopy.org | Reference | Downloads | Github

Problem while installing psychopy module in anaconda spyder

spyder

#1

Dear all,
I am trying to install psychopy module in Python anaconda spyder 32 bit. I have tried with pip install psychopy. Since it is company’s laptop it did not worked out well. Then I have tried to do it with proxy like ‘pip --proxy (IP add) install psychopy’. It got installed. When I tried to import various objects like core, data etc. It is showing me an import error like:

from psychopy import core, data, event, gui, visual
ImportError: cannot import name core 

Here is the code.

import serial
from time import sleep
import struct
from psychopy import core, data, event, gui, visual 

try:
    arduino = serial.Serial('COM8',19200)
    sleep(2)
    print("Connection to " + 'COM8' + " established succesfully!\n")
except Exception as e:
    print(e)

global command 
global win

win = visual.Window(size=(1680, 1050), fullscr=True, screen=0, allowGUI=True, allowStencil=False,
monitor='testMonitor', color=[0,0,0], colorSpace='rgb',
blendMode='avg', useFBO=True,
) #TODO: handle in a different way the screen resolution

instruction1 = visual.TextStim(win, text=u"""Press i to start!""")

instruction2 = visual.TextStim(win, text=u"""Press e to stop!""")

instruction3 = visual.TextStim(win, text=u"""Thank you!""")

instruction1.draw()  
sleep (2)  
win.flip()
if 'i' in event.waitKeys():
    sleep (2)
    command = arduino.write(struct.pack('>B', 1))
    instruction2.draw() 
    
    win.flip()
    if 'e' in event.waitKeys():
        sleep (2)
        command = arduino.write(struct.pack('>B', 0))
        instruction3.draw()    
        win.flip()
        win.close ()

arduino.close()

If I remove core from import, the next error will be data then event then GUI etc.
Can anyone help me to resolve this issue?
Greetings,
Ravi


#2

Hi @Ravi_Mevada, did you try to install PsychoPy for Anaconda using these guidelines?


#3

Hi @dvbridges, I have tried to follow those steps. First three works fine, but with the forth one, there is a problem. It is showing me packages not found error: The following packages are not available from the current channel then there is a list of current channels. I have tried to use those but still the same error. Then I have tried to install them one by one with pip and then it works. The forth step also works fine. Then I have tried to run the main script. Now I am getting error saying ‘no module named psychopy’. Then I have tried pip install psychopy but in return I am getting same error.