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, finding obvz.py or Installation step by step guide #6

Closed
michaelsjackson opened this issue May 1, 2020 · 17 comments
Closed

Comments

@michaelsjackson
Copy link

For installing obvz I set four parameters:

(setq obvz-dir "~/org-brain")
(setq obvz-python-version "/home/mj/miniconda3/bin/python")

(add-to-list 'load-path "~/packages/obvz")
(load-library "obvz")

Then when running:
M-x obvz-start

I am getting following error:
/home/mj/miniconda3/bin/python: can't open file 'obvz.py': [Errno 2] No such file or directory

What I could try? Thanks in advance. My python3 is there. At least this python is used when updating pip3, for example.

python --version gives:
Python 3.7.4

@swhalemwo
Copy link
Owner

swhalemwo commented May 1, 2020

hi! obvz-dir is supposed to be the main obvz folder (that where obvz.py file is located); it seems to me that you had set it to your org-brain directory instead? can you try setting it to ~/packages/obvz/ (it seems that's where you saved the obvz files)?

(also i'm not sure how load-library works, since i haven't packaged it properly yet I just load the elisp code with (load "~/path/to/obvz/obvz.el"))

@michaelsjackson
Copy link
Author

michaelsjackson commented May 1, 2020

Oh, thanks, this step is solved but next problem.

Traceback (most recent call last):
  File "obvz.py", line 7, in <module>
    from PyQt5.QtWidgets import QPushButton, QApplication, QWidget
ModuleNotFoundError: No module named 'PyQt5'

But I thought I installed PyQt5, it seems not. I used these commands.

sudo apt-get install python3-pyqt5
sudo apt-get install python3-pyqt5.qtsvg

How could I investigate correct installation of pyqt5, in which directories which files should be for example? Ubuntu 16.04 xenial here.

@michaelsjackson
Copy link
Author

Ok, I came further using:
pip3 install --user pyqt5

Now my error message looks as follows:

Traceback (most recent call last):
  File "obvz.py", line 40, in <module>
    from frucht_v3 import frucht
ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /home/mj/packages/obvz/frucht_v3.so)

@swhalemwo
Copy link
Owner

ah the lovely search for dependencies :) could it be a miniconda issue? I haven't used conda a lot, but iirc it has a separate package repo so idk how well it interacts with packages installed through apt.
maybe you can try conda install pyqt (as well as for the other dependencies), or alternatively use a "normal" python version?

@michaelsjackson
Copy link
Author

glibc 2.23 was released 2016-02-19

No I guess, maximum glibc is above for Ubuntu 16.04, and yours is a bit newer, 2.27.
glibc 2.27 was released 2018-02-01

Searching/Googling more, if there is any solution, can report back here, if I have something. Coming always closer 🚶‍♂️

@swhalemwo
Copy link
Owner

hmm the glib error seems to be due my c++ experiments where I cannot really say I understand all what's going on in the background. what i see on google is mostly the suggestion to upgrade to 18.04, but if you want to tinker with c++, eigen and pybind you could also try to compile the frucht_v3.cpp file on your system (the command i use is in the README).

@michaelsjackson
Copy link
Author

michaelsjackson commented May 1, 2020

How could I activate the non-cpp, slower version, if possible? Better than nothing.

Installed pybind:
pip3 install pybind11
I tried compiling with eigen installation
sudo apt install libeigen3-dev
But still complains:

./frucht_v3.cpp:2:23: fatal error: Eigen/Dense: No such file or directory
compilation terminated.

@michaelsjackson
Copy link
Author

michaelsjackson commented May 1, 2020

Came further using, added -I /usr/include/eigen3:
g++ -O3 -Wall -shared -std=c++17 -fPIC python3 -m pybind11 --includes -I /usr/include/eigen3 ./frucht_v3.cpp -o ./frucht_v3.so

But now getting some c++ errors.

./frucht_v3.cpp: In function ‘void update_dists(std::vector<std::pair<int, int> >, Eigen::Ref<Eigen::Matrix<float, -1, -1> >, Eigen::Ref<const Eigen::Matrix<float, -1, -1> >, Eigen::Ref<const Eigen::Matrix<float, -1, -1> >, int*)’:
./frucht_v3.cpp:275:27: error: ‘isnan’ was not declared in this scope

@swhalemwo
Copy link
Owner

i think (it's been a while) i used the eigen version from the eigen website since ubuntu repos always lag a bit behind. there's unfortunately no slower version anymore, after I saw what a speedboost c++ was I only implemented new features there.

@michaelsjackson
Copy link
Author

michaelsjackson commented May 1, 2020

No problem, thanks, I can try with the other Eigen then.

Do you have any guess, if this could be an error because of older/wrong Eigen version?
error: ‘isnan’ was not declared in this scope

@michaelsjackson
Copy link
Author

Installed latest Eigen, c++ error is less, meaning still no success, looks as follows:

 g++ -O3 -Wall -shared -std=c++17 -fPIC `python3 -m pybind11 --includes` -I /usr/local/include/eigen3 ./frucht_v3.cpp -o ./frucht_v3.so
./frucht_v3.cpp: In function ‘void update_dists(std::vector<std::pair<int, int> >, Eigen::Ref<Eigen::Matrix<float, -1, -1> >, Eigen::Ref<const Eigen::Matrix<float, -1, -1> >, Eigen::Ref<const Eigen::Matrix<float, -1, -1> >, int*)’:
./frucht_v3.cpp:275:27: error: ‘isnan’ was not declared in this scope
         if (isnan(new_dist)) {
                           ^
./frucht_v3.cpp:275:27: note: suggested alternative:
In file included from /usr/include/c++/5/complex:44:0,
                 from /usr/local/include/eigen3/Eigen/Core:28,
                 from /usr/local/include/eigen3/Eigen/Dense:1,
                 from ./frucht_v3.cpp:2:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^

@michaelsjackson
Copy link
Author

michaelsjackson commented May 1, 2020

Tried enough for today, I can continue another time. Thanks for all your help.

Tried one more thing, replacing isnan by something else, then it compiles, copied to obvz directory, window opens, but then I am getting other emacs errors.

Debugger entered--Lisp error: (error "Not in org-mode or org-brain-visualize")
  signal(error ("Not in org-mode or org-brain-visualize"))
  error("Not in org-mode or org-brain-visualize")
  org-brain-entry-at-pt()
  (obvz-get-node-name (org-brain-entry-at-pt))

Probably I should try with simpler brains first?

@swhalemwo
Copy link
Owner

no problem :) thanks for the detailed reports! i don't think it's related to eigen since isnan is afaik basic c++ functionality, maybe g++ works different between ubuntu versions. i'd try next std::isnan instead of just isnan, for me (18.04) it makes no difference but perhaps it's required on 16.04.

@michaelsjackson
Copy link
Author

std::isnan did it thanks. Now I can be sure at least I have a correct .so file, can investigate more, why now in emacs I am getting those errors, and how I can bypass those, somehow.

@michaelsjackson
Copy link
Author

When the QApplication window appears, it is empty here always, message is as follows in emacs:

QApplication: invalid style override 'gtk' passed, ignoring it.
	Available styles: Windows, Fusion

@michaelsjackson
Copy link
Author

Hey, it worked, success! Thanks a lot.

This time, I started org-brain-visualize first, then started obvz, hitting n and voila, window is filled with all those entries, my brain has more than 2000 .org files, cool, can play around now.

The above marathon was worth it in the end 🦘

@michaelsjackson
Copy link
Author

Tried svg export, it works as well, great. This issue can be closed if you want.

@michaelsjackson michaelsjackson changed the title Error, finding obvz.py Error, finding obvz.py or Installation step by step guide May 5, 2020
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