psychopy.org | Reference | Downloads | Github

Cannot start Psychopy - No module named 'lib2to3'

Whenever I try to start Psychopy, I get the following error:

$ psychopy
Traceback (most recent call last):
  File "/home/local/ADF/brookshg/.local/bin/psychopy", line 7, in <module>
    from psychopy.app.psychopyApp import main
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/psychopy/__init__.py", line 48, in <module>
    from psychopy.tools.versionchooser import useVersion, ensureMinimal
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/psychopy/tools/versionchooser.py", line 18, in <module>
    from psychopy import logging, tools, web, constants
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/psychopy/logging.py", line 39, in <module>
    from past.builtins import basestring
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/past/__init__.py", line 88, in <module>
    from past.translation import install_hooks as autotranslate
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/past/translation/__init__.py", line 41, in <module>
    from lib2to3.pgen2.parse import ParseError
ModuleNotFoundError: No module named 'lib2to3'

I’ve completely uninstalled psychopy and reinstalled using the instructions for Anaconda here. I’m running Ubuntu 18.04.3 LTS.

I’ve tried installing lib2to3 using pip and conda, but neither of those can find this package. I’d appreciate any suggestions!

I’ve uninstalled everything I can find, deleted the conda environment, and used pip uninstall to remove everything connected with psychopy. After reinstalling, I get this error:

Traceback (most recent call last):
  File "/home/local/ADF/brookshg/anaconda3/envs/psypy3/bin/psychopy", line 8, in <module>
    sys.exit(main())
  File "/home/local/ADF/brookshg/anaconda3/envs/psypy3/lib/python3.6/site-packages/psychopy/app/psychopyApp.py", line 100, in main
    start_app()
  File "/home/local/ADF/brookshg/anaconda3/envs/psypy3/lib/python3.6/site-packages/psychopy/app/psychopyApp.py", line 22, in start_app
    from psychopy.app._psychopyApp import PsychoPyApp
  File "/home/local/ADF/brookshg/anaconda3/envs/psypy3/lib/python3.6/site-packages/psychopy/app/_psychopyApp.py", line 31, in <module>
    import wx
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/home/local/ADF/brookshg/.local/lib/python3.6/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: /home/local/ADF/brookshg/anaconda3/envs/psypy3/bin/../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations

This seems like a pretty low-level error, and I haven’t been able to make any headway on fixing it.

I fixed this by removing my psychopy Anaconda environment, and reinstalling using the default python version (3.7) instead of python 3.6.

So this breaks: conda create -n psypy3 python=3.6
But this works: conda create -n psypy3