plandes/zotsite

Integrating zensols.zotsite into Ubuntu 16.04 LTS

datavectors opened this issue · 4 comments

I have spent some time integrating zensols.zotsite into my Ubuntu 16.04 environment and I encountered a few issues. I have managed to solve them so that I could better understand the inner workings of zensols.zotsite. But I add these notes for other users of Ubuntu 16.04.

My starting point was with Python 2.7 and Python 3.5 installed. I made the mistake of installing zensols.zotsite using pip and then pip3. But invalid syntax messages showed in running the command zotsite print.

zensols.zotsite depends on Python 3.6 not Python 3.5. I installed Python 3.6 via a PPA installation but could not get pip3 to place the package with Python 3.6 site-packages (as in 3.5). Also another side issue popped up. The default Ubuntu 16.04 gnome-terminal (shell) depends on Python 3.5 and terminal does not launch in Python 3.6. This bug was read here ..

https://stackoverflow.com/questions/49794432/how-to-setup-a-pipenv-python-3-6-project-if-os-python-version-is-3-5

I realised that I should be using a virtual environment so that different Python versions can be used and I referred to a few more documents.

https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-virtualenv-with-Python-3

After going through the above steps I created a virtual environment - virtualenv-zotsite - and within that virtual environment I ran pip3 to install

pip3 install -U zensols.zotsite

The next hurdle was that zensols.zotsite was looking for a non existent config file ~/.zoterorc and I created this with an entry pointing to the target Zotero data directory.

Finally tested again and encountered an error in opening sqlite3 file and found that Zotero has to be shutdown before using the zotsite commands. This lock of file is explained in zotsite README.

Conclusion. The advice to Ubuntu 16.04 users is to install and run zensols.zotsite in a Python 3.6 virtualenv.

The zotsite commands now work as documented.
My intention is to now export output into an Electron app.

Wow, quite an adventure. Thanks for your contribution in documenting this. I'll link to this issue from the README for others that might be on a Linux system with Python 3.5 or previous version.

Do you happen to have a copy of what your .zoterorc file looked like.

Thank you in advance.

It is some months since I last played with this. I am still in Ubuntu 16.04.
Looking at ~/.zoterorc content it has just two lines

[default]
data_dir=/home/userxxx/_ZOTERO/Zotero Electron

You can choose your own path to suit your configuration.

In "Zotero Electron" folder I have this filesystem ...

> locate
> pipes
> storage
> styles
> tmp
> translators
zotero-search-node.html
zotero.sqlite
zotero.sqlite-journal
zotero.sqlite1.bak
zotero.sqlite.bak


@JoeyColeman

There's an example already in the read me under Configuration File here.