Trouble installing on Ubuntu 18.04

I’m having trouble installing PsychoPy on Ubuntu 18.04.1. Any suggestions?

$ pip3 install psychopy

Runs fine until PyQt5… then this happens:

Collecting pyqt5 (from psychopy)
Downloading https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz (3.2MB)
100% |████████████████████████████████| 3.2MB 613kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python3.6/tokenize.py”, line 452, in open
buffer = _builtin_open(filename, ‘rb’)
FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/pip-build-0_kbkl9o/pyqt5/setup.py’

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-0_kbkl9o/pyqt5/

====

andrew@PSYPC6188:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

andrew@PSYPC6188:~$ python3 --version
Python 3.6.9

It looks like PyQt5 jumped to manylinux2014 wheels, which is only supported by pip versions >= 19.3 (ref). Without 2014 support, pip tries to install from source. Two easy options, I think:

a. Update pip (pip3 install --upgrade pip)
b. Install the previous release, which used manylinux1 (pip3 install pyqt5==5.14.0)

1 Like

Thank you that fixed the PyQt5 issue.

pip3 install --user ran to completion.

PsychoPy doesn’t launch however. I’ve fixed the first issue and am working on the second.

Can you provide more details, like:

  • What command do you use to launch PsychoPy?
  • If it doesn’t launch, are there errors? What is the full text of those errors?

Hi! I am new to psychopy. It’s been a few days I try to install psychopy on ubuntu 18.04.4 with no success (python version 3.7.5). I had the same problem described above, that I solved by updating pip. However, the setup failed and here is the error. Would you be able to help me? thanks

Running setup.py install for psutil … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-acjuomid/psutil/setup.py’"’"’; file=’"’"’/tmp/pip-install-acjuomid/psutil/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-bfzgilzc/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/andrea/.local/include/python3.7m/psutil
cwd: /tmp/pip-install-acjuomid/psutil/
Complete output (44 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/init.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psaix.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.7/psutil
creating build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/init.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/main.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.7/psutil/tests
running build_ext
building ‘psutil._psutil_linux’ extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/psutil
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/usr/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.7/psutil/_psutil_common.o
psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-acjuomid/psutil/setup.py’"’"’; file=’"’"’/tmp/pip-install-acjuomid/psutil/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-bfzgilzc/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/andrea/.local/include/python3.7m/psutil Check the logs for full command output.

If you’re using the system python, you’ll need the Python header files from python3-dev to install packages that need compilation (in this case, psutil doesn’t provide precompiled wheels for linux yet). If you sudo apt install python3-dev and retry, it should work?

Hi thank you for the earlier tips. I tried them under Root, and I appear to have the most recent version of PsychoPy.

However, whenever I try to run PsychoPy, the following output is produced

Traceback (most recent call last):
File “/usr/local/bin/psychopy”, line 5, in
from psychopy.app.psychopyApp import main
File “/usr/local/lib/python3.6/dist-packages/psychopy/ init .py”, line 44, in
from psychopy.preferences import prefs
File “/usr/local/lib/python3.6/dist-packages/psychopy/preferences/ init .py”, line 13, in
from . import preferences as prefsLib
File “/usr/local/lib/python3.6/dist-packages/psychopy/preferences/preferences.py”, line 285, in
prefs = Preferences()
File “/usr/local/lib/python3.6/dist-packages/psychopy/preferences/preferences.py”, line 67, in init
self.getPaths()
File “/usr/local/lib/python3.6/dist-packages/psychopy/preferences/preferences.py”, line 161, in getPaths
join(self.paths[‘themes’], file)
File “/usr/lib/python3.6/shutil.py”, line 121, in copyfile
with open(dst, ‘wb’) as fdst:
PermissionError: [Errno 13] Permission denied: ‘/home/micah/.psychopy3/themes/HiVisLight.json’

Now PsychoPy does not appear to even open, despite repeated reinstallations.

Would you have any advice please??