psychopy.org | Reference | Downloads | Github

Fail to sync with Pavlovia using conda-installed PsychoPy Ubuntu 18.04, extended question

OS : Ubuntu 18.04
**PsychoPy version : 2020.1.2 conda installed
**What are you trying to achieve? :
Be able to synch a created project from Psychopy Builder to Pavlovia.org

What did you try to make it work?:

I installed psychopy following instructions of this link
https://www.psychopy.org/download.html#linux

Starting from the below section
Anaconda and Miniconda

I used the environment file, and I made sure to install webkitgtk by typing below.

sudo apt install libwebkitgtk-1.0

Now, when I type the above code again, it shows below feedback.

Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libwebkitgtk-1.0-common’ for regex ‘libwebkitgtk-1.0’
Note, selecting ‘libwebkitgtk-1.0-0’ for regex ‘libwebkitgtk-1.0’
libwebkitgtk-1.0-0 is already the newest version (2.4.11-3ubuntu3).

python is 3.6.10

According to below forum discussion, and I had same experienced, I uninstall Psychtoolbox.

https://discourse.psychopy.org/t/ubuntu-psychtoolbox-keyboard-error/10265

Now, I am able to use Psychopy Builder and Coder. I can run a created experiment locally.
Even though I can still use Builder and Coder, there are still some wierd messages like below

Gtk-Message: time: Failed to load module “overlay-scrollbar”
Gtk-Message: time: Failed to load module “atk-bridge”
Gtk-Message: time: Failed to load module “canberra-gtk-module”
time: Debug: Adding duplicate image handler for ‘Windows bitmap file’
time: Debug: Adding duplicate image handler for ‘Windows bitmap file’
time: Debug: Adding duplicate image handler for ‘Windows bitmap file’

However, there are still problems to synch Psychopy builder to Pavlovia.org

I found a below forum discussion

https://discourse.psychopy.org/t/failing-to-sync-with-pavlovia-using-conda-installed-psychopy/6432/9

I did everything as they mentioned, but I still can’t synch to Pavlovia.org

I always receive similar error messages, when I clicked online synching buttons that say

Unable to load page

Problem occurred while loading the URL https://gitlab.pavlovia.org/oauth/authorize?client_id=4bb79f0356a566cd7b49e3130c714d9140f1d3de4ff27c7583fb34fbfac604e0&redirect_uri=https://gitlab.pavlovia.org/&response_type=token&state=b23f0763-e8c2-468c-8c33-96952f6e53de

TLS/SSL support not available; install glib-networking

When I clicked a button it says

  • find existing studies online

I was able to go further, but I couldn’t do anything else at all.

Now, I tried to install all version of webkitgtk

via apt

libwebkit2gtk-4.0-37/bionic-updates,bionic-security,now 2.28.2-0ubuntu0.18.04.1 amd64 [installed]
libwebkit2gtk-4.0-dev/bionic-updates,bionic-security,now 2.28.2-0ubuntu0.18.04.1 amd64 [installed]
libwebkitgtk-1.0-0/bionic,now 2.4.11-3ubuntu3 amd64 [installed]
libwebkitgtk-3.0-0/bionic,now 2.4.11-3ubuntu3 amd64 [installed,automatic]
libwebkitgtk-3.0-dev/bionic,now 2.4.11-3ubuntu3 amd64 [installed]

on conda
Name Version Build Channel
webkitgtk-cos6-i686 1.4.3 0
webkitgtk-cos6-x86_64 1.4.3 0
webkitgtk-devel-cos6-i686 1.4.3 0
webkitgtk-devel-cos6-x86_64 1.4.3 0

pip version
pip 20.1 pyh9f0ad1d_0 conda-forge

Now, I am really not sure what to do.

When I google TLS/SSL support not available; install glib-networking

I saw this problem everywhere, not just psychopy

NixOS/nixpkgs, case 1

https://github.com/NixOS/nixpkgs/issues/72579

NixOS/nixpkgs, case 2

https://github.com/NixOS/nixpkgs/issues/48789

Gimp forum

https://www.gimp-forum.net/Thread-F1-Help-broken-TLS-SSL-support-not-available-install-glib-networking

“Unable to access location, TLS/SSL support not available” when trying to connect to webdav

https://askubuntu.com/questions/1236560/unable-to-access-location-tls-ssl-support-not-available-when-trying-to-connec

GNU bug report logs - #37709
Unable to access Network Folders in GNOME

https://debbugs.gnu.org/db/37/37709.html

Yeah, installing in a conda environment on Ubuntu is currently pretty finicky (see #2836, #1979, and #2441). As I understand it, the basic issue with the failed sync is that there are old/incomplete libraries on conda-forge, and these older libraries get installed when creating an environment from the psychopy environment file. This means that any system level install of libraries will be ignored in favor of the ones from conda-forge.

As a workaround, you could use the following as your environment file (e.g., psychopy-env.yml). The main difference from the provided one is that it installs opencv from the default conda channel, and so won’t pull in glib

name: psychopy
channels:
- conda-forge
dependencies:
- python=3.6
- opencv=3.4.2
- psychopy
- pip
- pip:
  - psychtoolbox
  - pygame
  - pyo
  - pyparallel; platform_system != "Windows"
  - SoundFile; platform_system == "Windows"

I think that an environment you create with this file will allow you to sync your experiments online.

However, when you start psychopy, you may still see warnings about modules failing to load (e.g., Failed to load module "overlay-scrollbar"). If not, great! Could you report whether that’s the case? If you do see those messages, I think this is another case of the libraries provided by conda-forge being incomplete. The only solution I know of would be to remove the libraries from conda, e.g.

rm <anaconda3>/envs/psychopy/lib/*gnutls*
rm <anaconda3>/envs/psychopy/lib/*gio*

where <anaconda3> is the location of your anaconda installation. Then, when you install the modules using apt, psychopy will be able to find them. e.g.,

sudo apt install overlay-scrollbar-gtk2 \
                 libcanberra-gtk-module \
                 libatk-adaptor \
                 libwebkitgtk-1.0-0

HTH

1 Like

Hi psadil,

Thank you for a feedback!

I will try those instructions and whether any of them would work!

Thanks!
H

Hi psadil,

I was able to synch and log in to Pavlovia.org for the first time ever !!!

I followed your instructions as below:

I actually deleted “psychopy” environment so that I can freshly start from scratch and check any replicable condition I can find.

OS: ubuntu 18.04

Installation instruction is similar to the below

https://www.psychopy.org/download.html#linux

Anaconda and Miniconda

We provide an environment file that can be used to install PsychoPy and its dependencies. Download the file, open your terminal, navigate to the directory you saved the file to, and run:

conda env create -n psychopy -f psychopy-env.yml

I used your environment setting as below

name: psychopy
channels:

  • conda-forge
    dependencies:
  • python=3.6
  • opencv=3.4.2
  • psychopy
  • pip
  • pip:
    • psychtoolbox
    • pygame
    • pyo
    • pyparallel; platform_system != “Windows”
    • SoundFile; platform_system == “Windows”

After I saved the above information as psychopy-env.yml
I ran below command;

conda env create -n psychopy -f psychopy-env.yml

Then, psychopy environment is created.
I activated the environment by

conda activate psychopy

I immediately tried to run in the psychopy environment,

psychopy

First attempt Failed, errors said

Traceback (most recent call last):
File “anaconda directory/anaconda3/envs/psychopy/bin/psychopy”, line 11, in
sys.exit(main())
File “anaconda directory/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/psychopyApp.py”, line 100, in main
start_app()
File “anaconda directory/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/psychopyApp.py”, line 22, in start_app
from psychopy.app._psychopyApp import PsychoPyApp
File “anaconda directory/anaconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/_psychopyApp.py”, line 32, in
import wx
File “anaconda directory/anaconda3/envs/psychopy/lib/python3.6/site-packages/wx/init.py”, line 17, in
from wx.core import *
File “anaconda directory/anaconda3/envs/psychopy/lib/python3.6/site-packages/wx/core.py”, line 12, in
from ._core import *
ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

This is different from the environment file given by the psychopy website, which actually be able to open psychopy properly, but a new enviroment provided by psadil did not open and showed this error.

So I tried to go back to check if it is a problem of missing libwebkitgtk-1.0 file/package.
Then, I ran below command,

sudo apt install libwebkitgtk-1.0

Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libwebkitgtk-1.0-common’ for regex ‘libwebkitgtk-1.0’
Note, selecting ‘libwebkitgtk-1.0-0’ for regex ‘libwebkitgtk-1.0’
libwebkitgtk-1.0-0 is already the newest version (2.4.11-3ubuntu3).
The following package was automatically installed and is no longer required:
libnvidia-common-440
Use ‘sudo apt autoremove’ to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 9 not to upgrade.

Obviously, conda or sudo apt could not solve this problem.

Actually, there are some problems of missing some packages.

Then, going to back to the https://www.psychopy.org/download.html#linux

and download various versions of wxPython wheel

instructed as below

Then fetch a wxPython wheel for your platform from:

https://extras.wxpython.org/wxPython4/extras/linux/gtk3/

and having downloaded the right wheel you can then install it with something like:

pip install path/to/your/wxpython.whl


Currently, available wheel for Python 3.6 is

  • wxPython-4.0.2-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.0.3-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.0.6-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.0.7-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.0.7.post1-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.0.7.post2-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.1.0-cp36-cp36m-linux_x86_64.whl
  • wxPython-4.1.0-cp37-cp37m-linux_x86_64.whl

I downloaded them, and tried to compare which version seems to be working.

wxPython-4.0.2 - 4.0.7

when I command, psychopy

similar errors came up like below

ImportError: libpng12.so.0: cannot open shared object file: No such file or directory
libgio-2.0.so.0: undefined symbol: g_unix_get_passwd_entry

However, when I installed the latest version, which is below at a moment,

wxPython-4.1.0-cp37-cp37m-linux_x86_64.whl

errors that sound problems are close to be solved

20:01:11: Debug: Adding duplicate image handler for ‘Windows bitmap file’
20:01:11: Debug: Adding duplicate animation handler for ‘1’ type
20:01:11: Debug: Adding duplicate animation handler for ‘2’ type
20:01:11: Debug: Adding duplicate image handler for ‘Windows bitmap file’
20:01:11: Debug: Adding duplicate animation handler for ‘1’ type
20:01:11: Debug: Adding duplicate animation handler for ‘2’ type
20:01:11: Debug: Adding duplicate image handler for ‘Windows bitmap file’
20:01:11: Debug: Adding duplicate animation handler for ‘1’ type
20:01:11: Debug: Adding duplicate animation handler for ‘2’ type

Then, I used your tricks,

rm /envs/psychopy/lib/gnutls
rm /envs/psychopy/lib/gio

mainly, I used below command within the /envs/psychopy/lib directory

find . -name "*gio*"
find . -name "*gnutls*"

ok, it was little bit overwhelming amounts of files show up

./libgio-2.0.so.0
./libgio-2.0.so
./libgio-2.0.so.0.6400.3
./gstreamer-1.0/libgstgio.so
./python3.6/site-packages/moviepy/video/fx/freeze_region.py
./python3.6/site-packages/moviepy/video/fx/pycache/freeze_region.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/_trustregion_krylov.py
./python3.6/site-packages/scipy/optimize/_trustregion_constr
./python3.6/site-packages/scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py
./python3.6/site-packages/scipy/optimize/_trustregion_constr/pycache/minimize_trustregion_constr.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/_trustregion.py
./python3.6/site-packages/scipy/optimize/_trustregion_dogleg.py
./python3.6/site-packages/scipy/optimize/_trustregion_exact.py
./python3.6/site-packages/scipy/optimize/tests/test_trustregion_exact.py
./python3.6/site-packages/scipy/optimize/tests/test_trustregion_krylov.py
./python3.6/site-packages/scipy/optimize/tests/test_trustregion.py
./python3.6/site-packages/scipy/optimize/tests/pycache/test_trustregion_krylov.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/tests/pycache/test_trustregion_exact.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/tests/pycache/test_trustregion.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/pycache/_trustregion_exact.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/pycache/_trustregion_krylov.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/pycache/_trustregion_dogleg.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/pycache/_trustregion.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/pycache/_trustregion_ncg.cpython-36.pyc
./python3.6/site-packages/scipy/optimize/_trustregion_ncg.py
./python3.6/site-packages/OpenGL/raw/WGL/ARB/buffer_region.py
./python3.6/site-packages/OpenGL/raw/WGL/ARB/pycache/buffer_region.cpython-36.pyc
./python3.6/site-packages/OpenGL/raw/EGL/NOK/swap_region.py
./python3.6/site-packages/OpenGL/raw/EGL/NOK/pycache/swap_region2.cpython-36.pyc
./python3.6/site-packages/OpenGL/raw/EGL/NOK/pycache/swap_region.cpython-36.pyc
./python3.6/site-packages/OpenGL/raw/EGL/NOK/swap_region2.py
./python3.6/site-packages/OpenGL/WGL/ARB/buffer_region.py
./python3.6/site-packages/OpenGL/WGL/ARB/pycache/buffer_region.cpython-36.pyc
./python3.6/site-packages/OpenGL/EGL/NOK/swap_region.py
./python3.6/site-packages/OpenGL/EGL/NOK/pycache/swap_region2.cpython-36.pyc
./python3.6/site-packages/OpenGL/EGL/NOK/pycache/swap_region.cpython-36.pyc
./python3.6/site-packages/OpenGL/EGL/NOK/swap_region2.py
./pkgconfig/gio-2.0.pc
./pkgconfig/gio-unix-2.0.pc

For gio files,

I assumed I should removed files like libgio.xxx , gio.xxx
So, I removed

./libgio-2.0.so.0
./libgio-2.0.so
./libgio-2.0.so.0.6400.3

./pkgconfig/gio-2.0.pc
./pkgconfig/gio-unix-2.0.pc

For gnutls files,

I removed below files, as I assumed

./libgnutlsxx.so.28.1.0
./libgnutls.so.30.14.11
./libgnutlsxx.so
./libgnutls.so.30
./libgnutls.so
./libgnutlsxx.so.28
./libgnutls.la
./pkgconfig/gnutls.pc
./libgnutlsxx.la

Then, I command your instruction, as below,

sudo apt install overlay-scrollbar-gtk2 \
                 libcanberra-gtk-module \
                 libatk-adaptor \
                 libwebkitgtk-1.0-0

Reading package lists… Done
Building dependency tree
Reading state information… Done
libatk-adaptor is already the newest version (2.26.2-1).
libcanberra-gtk-module is already the newest version (0.30-5ubuntu1).
libwebkitgtk-1.0-0 is already the newest version (2.4.11-3ubuntu3).
overlay-scrollbar-gtk2 is already the newest version (0.2.17.1+16.04.20151117-0ubuntu2).
The following package was automatically installed and is no longer required:
libnvidia-common-440
Use ‘sudo apt autoremove’ to remove it.
0 to upgrade, 0 to newly install, 0 to remove and 9 not to upgrade.

It seems like this command is not essential.
I should try to run psychopy and see if this work without the above your instruction.

After all of the above, I run psychopy and I can launch psychopy builder with below message.

19:17:17: Debug: Adding duplicate image handler for ‘Windows bitmap file’
19:17:17: Debug: Adding duplicate image handler for ‘Windows bitmap file’
19:17:17: Debug: Adding duplicate image handler for ‘Windows bitmap file’

What is most important here is that, I can also synch my project through Builder now!

Thank you very much for your helps!!! It worked perfectly!!!

Only one of minor concern I have now, is why it was not essential not needing to remove a file of

./gstreamer-1.0/libgstgio.so

But that is beyond my knowledge…

Anyway, thank you for your advice!

Best,
H

Glad that you’ve got things working!

If things are working to your satisfaction, it’s probably best to leave them as is. But there are a couple of things that I might be able to clarify.

That first error you saw

First attempt Failed, errors said […]

The important part is the last line


ImportError: libpng12.so.0: cannot open shared object file: No such file or directory

This is related to wxPython, but not exactly about wxPython. The instructions you linked, https://www.psychopy.org/download.html#linux, about downloading wxPython were for if you installed psychopy using pip, not using a conda environment. There are some important differences in how those two installations work. The environment that you created probably already had a copy of wxPython installed. This is why, when you (re)installed wxPython manually, you still saw the same error about the failure to access libpng12.so.0. The .so in the filename stands for ‘shared object’; it’s a program that lives on your machine and which a lot of other packages will use (like wxPython). What the error is saying is that wxPython is trying to access the file and can’t find it. This usually means that something isn’t installed. The next step that I would have tried at this point is to install this package (EDIT: something like sudo apt install libpng-dev. I’m not sure exactly which package would need to be installed to give you libpng12.so.0).

For the next part, I’m actually a bit concerned about the files that you deleted. In my last response, I wrote that the files that were a part of your anaconda installation. Those files would be located within the folder that anaconda itself is installed to. This is what I meant by <anaconda3>. For me, the files all live inside /home/psadil/anaconda3/. But in that list of files you output, each file started with ./, a ‘dot’ followed by /. The dot means ‘current directory’, so it’s not entirely clear from where you deleted those files.
Hopefully that clears up some of those messages you saw. But like I said, glad that you’ve gotten things working.

Best,

1 Like

Hi psadil

Sorry, it was little bit unclear to point out those two points, (and I encoutered another, but this is an ignore-able problem).

<For the 1st point:>

I actually skipped to mention that I actually tried to install libpng12.so.0, but this approach did not work.

based on below forum

https://github.com/DeepLabCut/DeepLabCut/issues/163

I tried to install below package,

sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb

or based on below forum,

https://github.com/tcoopman/image-webpack-loader/issues/95

I tried to install below package,

sudo apt-get install libpng-dev

but after both ways of installation, both results showed similar errors as shown in my previous message, like missing libgio-2.0.so.0: undefined symbol: g_unix_get_passwd_entry

and I found below forum,

https://github.com/psychopy/psychopy/issues/2802

here said, glib version might need to be changed?
so i tried and compared different version of wxPython, like my previous message.

For the 2nd point:

sorry, I should leave a full path.

an actual full path was like below,

(I created a folder, called “work” for an entire work of anaconda3)

/home/“this is my user name”/work/anaconda3/envs/psychopy/lib/

I moved to the above directory and run below code,

So, I deleted the below files from the “psychopy” directory, not from an entire “anaconda3” directory.

Do you think this might cause any problems?

A new, but ignore-able problem showing up:

After syncing function starts working with current setup, syncing in psychopy builder is done by pressing buttons of images or icons on the second row or the second top toolbar of the Psychopy builder.

However, current setup no longer be able to press the first or top toolbar buttons, such as File, Edit, Tools, View, Experiment, etc. I cannot do left clicks with pc mouse to press those buttons anymore. What I can do is pressing icons, that are for synching projects with Pavlovia.org.

Also, there were error messages on terminal,

(psychopy:12519): Gdk-CRITICAL **: 23:20:56.008: Window 0x56507f9c0e20 has not been made visible in GdkSeatGrabPrepareFunc

I am not sure how to fix this, and at the same time, maintiaining to keep the synching function.

I am already happy that synching function can be used.

Actually, this error can be ignored. I am thinking to create another conda environment then I create a pyschopy project locally in the environment and synching projects with this current environment.

But I wished all those issues and problems are fixed in the following version update.

A big appreciation to psadil! and please let me know if there is any issues or anything I can help to try!

Best,
H

Cool, thanks for the extra info. As before, since you’ve got things working feel free to skim through my response. But, I think there is a bit more that I can clarify.

This is actually a different error. Note that there is no mention of libpng12.so.0. So, installing libpng-dev fixed the problem that it was trying to solve (i.e., locate the missing libpng12.so.0 file for wxPython).

This error is about a different package, libgio. I’m not sure why this error appeared for you. Part of it might depend on which conda environment you were working in at this point (e.g., the one provided by psychopy or the one with opencv=3.4.2). If this is a case of an outdated package provided by conda, then the advice to delete files following the <anaconda3>/envs/psychopy/lib/*gio* pattern might have been what solved this particular error.

phew. I was concerned about the possibility that the files you listed were associated with your system. It’s probably fine to have removed those files. anaconda can always be reinstalled if you delete something in the anaconda directory which later turns out to be necessary.

However, note that your call involving the command find is subtlety but importantly different than what I was originally advising. For example, the output of find . -name "*gio*" will list files that contain the substring ‘gio’, and it will look for files recursively. This is why the list of files you got was so long. The command that I initially suggested did not recurse into deeper directories. It was only going to find files containing the substring ‘gio’, which were located in the directory <anaconda3>/env/psychopy/. The list of files would have been analogous to the output of ls <anaconda3>/envs/psychopy/lib/*gio*. The list of files output by find is much longer, and deleting many of these would cause other problems. But from the sound of it you picked up on mostly the right files (although I’m not sure about the effect of deleting the files in the pkgconfig folder).

Those last errors you mention – about not being able to use the File tab or bit starting with Gdk-CRITICAL – sounds kind of serious to me. My guess is that your installation isn’t quite right yet, but I really don’t know what they mean.

1 Like