Trouble installing psychopy into anaconda

Hello! I am trying to install psychopy into anaconda following the instructions here: Installation — PsychoPy v2022.1.4

I am using conda:python3.7, windows 10 (x64-based processor).

  1. I have successfully completed the first step (creating the environment). However, after I typed ‘conda activate psychopy’, the following error ('you may need to restart the kernel to use updated packages) occurs.
    image

When I tried to run psychopy, an error ‘NameError: name ‘psychopy’ is not defined’ occurs.

I have tried restarting the kernel but it didn’t work either.

  1. I tried following steps suggested by ronald in this thread as well (Installing Psychopy with Anaconda - #7 by uliw).
    It never successfully created a python 2.7 environment.

Is there anything I can do? Thanks a lot!

By “restarting the kernel”, are you referring to working within a Jupiter or iPython notebook? Because conda commands should be executed in the terminal, not in Python.

Similarly, this is an error from within Python. Both of those instructions (conda activate psychopy and psychopy) are meant to be typed at the terminal (i.e. the command line interface to your operating system), not from within Python.

Ignore that very old thread - modern PsychoPy should be installed in an environment with Python 3.8.

Thanks Michael!
I am working within the iPython console in the anaconda interface (sorry for the confusion! I am quite new to this).

In the end I entered ‘conda install -c conda-forge psychopy’ in iPython console (in anaconda) which seemed to have helped install psychopy successfully. But when I tried to ‘open window’, an error occured ( OSError: [WinError -2147417850] Cannot change thread mode after it is set). The error was solved by downgrading pyglet from 1.5 to 1.4.10 (following this thread: OSError: [WinError -2147417850] Cannot change thread mode after it is set · Issue #2876 · psychopy/psychopy · GitHub).