gregdetre / emacs-freex

Emacs Freex mode is a minor mode for organizing and editing a massively-hyperlinked database of your notes and ideas. It's a personal wiki on steroids.
GNU General Public License v2.0
77 stars 11 forks source link

installation errors, does freex work with emacs 24? #3

Open trenkert opened 10 years ago

trenkert commented 10 years ago

I cannot install freex. When I try to eval-buffer freex-test-conf.el I get this:

Saving file /home/bob/elisp/emacs-freex/freex-conf-test.el... Wrote /home/bob/elisp/emacs-freex/freex-conf-test.el eval-buffer: Wrong number of arguments: #[(file form) ";ƒ.. [file regexp-or-feature after-load-alist elt form lexical-binding purecopy load-history-regexp assoc funcall ...] 18 1621237], 1

When I eval-buffer freex-mode.el, I get:

Pymacs loading freex_sqlalchemy... pymacs-report-error: Python: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/Pymacs/pymacs.py", line 146, in loop value = eval(text) File "<string>", line 1 SyntaxError: more than 255 arguments

on freex-embed.el:

(lambda (elem) ...) quoted with ' rather than with #'

on freex-meta.el:

Pymacs loading freex_sqlalchemy...done pymacs-report-error: Python: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/Pymacs/pymacs.py", line 146, in loop value = eval(text) File "<string>", line 1, in <module> File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 596, in create_fsqa fsqa = Fsqa(database_file,use_lisp,in_memory,file_ext) File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 323, in __init__ self.initialize_db() File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 345, in initialize_db self.nuggets.create() File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 616, in create checkfirst=checkfirst) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1478, in _run_visitor with self._optional_conn_ctx_manager(connection) as conn: File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1471, in _optional_conn_ctx_manager with self.contextual_connect() as conn: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1661, in contextual_connect self.pool.connect(), File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 272, in connect return _ConnectionFairy(self).checkout() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init__ rec = self._connection_record = pool._do_get() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 871, in _do_get return self._create_connection() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection return _ConnectionRecord(self) File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in __init__ self.connection = self.__connect() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 379, in __connect connection = self.__pool._creator() File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect return dialect.connect(*cargs, **cparams) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 283, in connect return self.dbapi.connect(*cargs, **cparams) OperationalError: (OperationalError) unable to open database file None None

and on freex-mode.el

Pymacs loading freex_sqlalchemy...done pymacs-report-error: Python: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/Pymacs/pymacs.py", line 146, in loop value = eval(text) File "<string>", line 1, in <module> File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 596, in create_fsqa fsqa = Fsqa(database_file,use_lisp,in_memory,file_ext) File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 323, in __init__ self.initialize_db() File "/home/bob/elisp/emacs-freex/freex_sqlalchemy.py", line 345, in initialize_db self.nuggets.create() File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 616, in create checkfirst=checkfirst) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1478, in _run_visitor with self._optional_conn_ctx_manager(connection) as conn: File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1471, in _optional_conn_ctx_manager with self.contextual_connect() as conn: File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1661, in contextual_connect self.pool.connect(), File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 272, in connect return _ConnectionFairy(self).checkout() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init__ rec = self._connection_record = pool._do_get() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 871, in _do_get return self._create_connection() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection return _ConnectionRecord(self) File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in __init__ self.connection = self.__connect() File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 379, in __connect connection = self.__pool._creator() File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect return dialect.connect(*cargs, **cparams) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 283, in connect return self.dbapi.connect(*cargs, **cparams) OperationalError: (OperationalError) unable to open database file None None

byte-compile also aborts with errors.

gregdetre commented 10 years ago

I'm sorry to hear that. Unfortunately, I don't feel I can actively maintain Freex any more. It works well once installed, but it's going to take a major effort to debug & improve this installation process for you.

trenkert commented 10 years ago

Do you know of anyone else besides yourself using freex? I would be interested in helping to improve it but only if there is someone who is willing to maintain it. I saw your comment on Sacha Chua's blog 10 months ago and thought that there would be at least some interest within the emacs user base to get it up to date.

Out of curiosity: What version of emacs, python and sqlalchemy are you running?

analyticd commented 7 years ago

I have it working on macOS Sierra with Emacs 25.1.1 (but this should work for earlier OS X versions). I made Anaconda python 2.7.11 my default (it may work, haven't tried, with other versions, that is just what I had activated in my Anaconda system as the default environment). Once Anaconda is my default python I install sqlalchemy (latest - which happened to be 1.1.4 for my python environment). The trickiest part is getting Pymacs to install correctly. Follow the directions (just for Pymacs, not all the other stuff) at http://milkbox.net/note/installing-pymacs-rope-on-emacs-24/ (or follow the same instructions in the gist of my freex-conf.el below). The only change to what is written there for me was that the source was located in ~/src/pymacs (as noted in my gist). Also, be careful to do the check for correct Pymacs installation as described in that referenced article (also noted in my freex-conf.el). You won't be using the provided Pymacs that comes with freex (it turned out to be the same version of Pymacs, but I moved Pymacs.py from freex out of the way just in case it wasn't). Make all the configuration changes that are required (as mentioned by the author). Be sure to include (setq freex-enable-implicit-links t). This had to be added to make implicit links work. The author mistakenly removed this, but it is still required. Here is my config, hope it helps: https://gist.github.com/analyticd/fa77ef6c50d2e53b65f78d6f250994e9 And of course, then you must do (load "/path/to/freex-conf.el") from your init.el, .emacs, or the elisp repl to load it into memory.

gregdetre commented 7 years ago

@analyticd Wow! This is flat out amazing of you. Well done. I've been feeling guilty about updating the docs for recent versions of OS X for a while.

Now that you've got it installed, I'd be delighted to offer any suggestions for how to make daily use of Freex! After >10 years, I'm still using it dozens and dozens of times a day.

mbrockman1 commented 7 years ago

I know this is an old program. Dr. Sederberg actually showed it to me. I've been trying to get it installed on my mac but I keep on getting an import error for freex_sqlalchemy. The program runs perfectly when I'm in the freex directory containing the scripts, but once I leave I get the import error that freex_sqlalchemy is missing

mbrockman1 commented 7 years ago

@analyticd would it be possible for you to post your emacs.d directory on github so I can see your freex configurations?

analyticd commented 7 years ago

Hi @mbrockman1, to install sqlalchemy you'll want to use the package installation tools that come with the python distribution you use. For example, I use Anaconda and Anaconda provides pip for instance which can handle the task of installing sqlalchemy ala: pip install sqlalchemy. Same for pymacs. Just bear in my mind the complication, which I didn't mention in my notes above, that if you have more than one python distribution on your machine, e.g., Apple's and Anaconda, you need to make sure your path is set so that you are using the installation tools, e.g., pip, that are associated with the python distrib you intended to use. Read carefully my config and notes which I provided above for the rest. You won't need the rest of my Emacs config.

mbrockman1 commented 7 years ago

I fixed my sqlachemy issue by pip installing sqlalchemy then adding the location of my Freex and Pymacs to my PYTHONPATH

export PYTHONPATH="${PYTHONPATH}:$HOME/.emacs.d/el-get/Pymacs"
export PYTHONPATH="${PYTHONPATH}:$HOME/.emacs.d/el-get/freex"
analyticd commented 7 years ago

Ok, had time to return to this. I didn't need the PYTHONPATH stuff, but thank you mbrockman1 for helping. What it was was something silly, you have to (at least I did) provide an absolute path to sqlite3 database, you can't use ~ in the path (there were many Q/As on this at stackoverflow), or you can get an operational error from sqlite3. I updated the linked config at the top of this thread to include notes about this issue and another issue discovered whereby loading freex-mode was failing when using a relative path to freex-mode.el. It seems to be working fine again now.

ychaouche commented 7 years ago

Yup, didn't have to touch the PYTHONPATH either. What happens is that pymacs calls the python interpreter and asks it to load the freex_sqlalchemy module which is in /where/freex/is/installed/freex_sqlalchemy.py. By default, the python only knows about standard places to look for its modules, like /usr/lib/python2.x/ or similar (if you're using python2.x), but it won't find anything under /where/freex/is/installed because that's not a standard location for python modules.

What you can do is add that path to the pymacs-load-path variable, like so (in .emacs for eg.) : (eval-after-load "pymacs" '(setq pymacs-load-path (list "/where/freex/is/installed")))

Be sure to also add the following lines before it, because unless pymacs is loaded pymacs-load-path isn't defined.

(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(autoload 'pymacs-autoload "pymacs")
(eval-after-load "pymacs" '(setq pymacs-load-path (list "/home/ychaouche/.emacs.d/emacs-freex-master/")))

Now I am facing this error which is coming from the python interpreter :

NoSuchTableError: nuggets

This is when I load freex-conf.el and it tries to load the (empty) database. Before that, python complained about not finding the database, so I created an empty file called freex.db and then I had this new NoSuchTableErro: nuggets which I don't know how to fix yet.

ychaouche commented 7 years ago

Fixed https://github.com/gregdetre/emacs-freex/issues/6

ychaouche commented 7 years ago

btw who's doctor sederberg ?

mbrockman1 commented 7 years ago

https://github.com/gregdetre/emacs-freex/graphs/contributors

ychaouche commented 7 years ago

Ack @mbrockman1