Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing on Ubuntu #268

Closed
gbrookshire opened this issue Dec 14, 2020 · 2 comments
Closed

Error installing on Ubuntu #268

gbrookshire opened this issue Dec 14, 2020 · 2 comments

Comments

@gbrookshire
Copy link

gbrookshire commented Dec 14, 2020

** I eventually got this working. I've left these comments for anyone who runs into the same errors I did. **

I tried installing following the instructions here:
https://jonescompneurolab.github.io/hnn/installer/ubuntu/

Initially bash hnn-ubuntu.sh crashed because of problems with unrelated PPAs. I fixed those issues and the ran the script again, and it successfully downloaded the directory hnn_source_code/.

When I try to run HNN, I get this error:

$ python hnn.py                                                                            (hnn) 
Traceback (most recent call last):
  File "hnn.py", line 10, in <module>
    from hnn_qt5 import *
  File "/home/geoff/Downloads/hnn_source_code/hnn_qt5.py", line 4, in <module>
    from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication, QToolTip, QPushButton, QFormLayout
ImportError: No module named PyQt5.QtWidgets

When I try to install PyQt5, I get a message saying it's already installed.

$ pip install PyQt5                                                                        (hnn) 
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: PyQt5 in /home/geoff/.local/lib/python3.6/site-packages (5.15.2)
Requirement already satisfied: PyQt5-sip<13,>=12.8 in /home/geoff/.local/lib/python3.6/site-packages (from PyQt5) (12.8.1)

Directly importing PyQT in python works fine:

$ python                                                                                   (hnn) 
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> 

I tried uninstalling and reinstalling PyQt like this:

pip uninstall PyQt5
pip uninstall pyqtwebengine
pip install PyQt5==5.12.1 pyqtwebengine==5.12.1

And now I'm getting this error:

$ python hnn.py                                                                            (hnn) 
Traceback (most recent call last):
  File "hnn.py", line 10, in <module>
    from hnn_qt5 import *
  File "/home/geoff/Downloads/hnn_source_code/hnn_qt5.py", line 4, in <module>
    from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication, QToolTip, QPushButton, QFormLayout
ImportError: /home/geoff/.local/lib/python3.6/site-packages/PyQt5/QtWidgets.so: undefined symbol: _Py_Dealloc

I was using the fish shell for this. When I uninstall everything and try again in a bash shell, it hangs for a few minutes and then installs and gives this error:

$ python3 hnn.py 
Traceback (most recent call last):
  File "hnn.py", line 10, in <module>
    from hnn_qt5 import *
  File "/home/geoff/Downloads/hnn_source_code/hnn_qt5.py", line 29, in <module>
    import nlopt
ModuleNotFoundError: No module named 'nlopt'

After running pip install nlopt, it's working! For anyone who runs into the same problems in the future, here are the steps I used to get HNN working in Ubuntu 18.04:

  • Delete any PPAs that throw warnings or errors.
  • Use bash instead of another shell (which is surprising since the installation script is explicitly called with bash)
  • Manually run pip install nlopt.
@blakecaldwell
Copy link
Member

Thanks for including the fixes to your issue @gbrookshire. An upcoming update to the documentation includes the necessary pip install commands, and does not have the user run hnn-ubuntu.sh

@blakecaldwell
Copy link
Member

Fixed in #280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants