Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

OpenSeasame in Anaconda: cannot import name Qsci

Hi,

I am running Ubuntu 17.04 and just installed Anaconda, and then OpenSesame under Anaconda.
When trying to run OpenSesame, I get the following Python error:

Traceback (most recent call last):
File "/home/luke/anaconda2/bin/opensesame", line 25, in
main.opensesame()
File "/home/luke/.local/lib/python2.7/site-packages/libqtopensesame/main.py", line 80, in opensesame
opensesame.resume_init()
File "/home/luke/.local/lib/python2.7/site-packages/libqtopensesame/qtopensesame.py", line 105, in resume_init
from QProgEdit import validate
File "/home/luke/.local/lib/python2.7/site-packages/QProgEdit/init.py", line 69, in
from QProgEdit._quiloader import QUiLoader
File "/home/luke/.local/lib/python2.7/site-packages/QProgEdit/_quiloader.py", line 23, in
from QProgEdit.pyqt5compat import uic
File "/home/luke/.local/lib/python2.7/site-packages/QProgEdit/pyqt5compat.py", line 22, in
from PyQt5 import Qsci
ImportError: cannot import name Qsci

I'm not sure why it's trying to look for a whole bunch of packages outside of /home/luke/anaconda2/bin, even though it's already in my PATH variable. Would anyone know how to fix these path problems?

Thanks!
Luke.

Comments

  • Hi Luke,
    We are having problems composing the qt5 dependencies for OpenSesame on Anaconda. Continuum (the maintainers of Anaconda) are having a hard time maintaining qt5 because Riverbank (the maintainers of Qt5) have dropped support for the compiler Continuum used to build all the Anaconda packages with (see here for a post I did concerning this on their forum). Therefore, the Qt5 version is stuck at 5.6.2 on Anaconda until Continuum figures out their next steps.

    There are however a few easy solutions around this:

    • Riverbank does provide wheels (a sort of package container for python) for PyQt5 and QScintilla2 on pip. You should thus be able to simply install the newest PyQt5 and QScintilla2 dependencies with:
    pip install PyQt5 QScintilla
    

    although I am not sure there wheels for Linux too.

    • You could always still use the standard Ubuntu repositories for installing the packages you miss, although I don't know how well that will play together with Anaconda. I don't really remember the precise command, but you could try installing qscintilla2 with
    sudo apt install python-qscintilla2
    

    Maybe @smathot is of better help to you here, because he is an avid Ubuntu user too.

  • Hi Luke,

    To me it looks like Anaconda is picking up libraries that you have installed previously with the pip that belongs to Ubuntu's default Python environment. You would think that Anaconda ignores those, so this is a bit strange. Have you explicitly set your PYTHON_PATH to include /home/luke/.local/lib/python2.7/site-packages/ or something?

    Cheers,
    Sebastiaan

  • Hi Sebastiaan,

    When I do echo $PYTHON_PATH, I don't actually get anything, but when I do echo $PATH, I get this:

    /home/luke/anaconda2/bin:/home/luke/anaconda2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    

    My ~/.profile file has this line at the end:

    export PATH=$HOME/anaconda2/bin:$PATH
    
  • I think that Python looks in .local/lib/python2.7/site-packages/ by default, even if it's not in the Python path. That would be strange in the case of Anaconda, because it means that Anaconda is not cleanly separated from your regular Python distribution—which is kind of the point.

    What do you get if you run python (the Anaconda one) and enter the code below?

    import site
    print(site.getusersitepackages())
    

    PS. The regular PATH variable is for locating executables. That doesn't have anything to do with Python.

  • When I load up python, I get this output:

    Python 2.7.13 |Anaconda 4.3.1 (64-bit)| (default, Dec 20 2016, 23:09:15) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: http://continuum.io/thanks and https://anaconda.org
    >>> import site
    >>> print (site.getusersitepackages())
    /home/luke/.local/lib/python2.7/site-packages
    >>> 
    
Sign In or Register to comment.