MontrealCorpusTools / PolyglotDB

Language data store and linguistic query API
MIT License
36 stars 13 forks source link

problem installing polyglotdb on windows laptop #180

Open JaneStuart-Smith opened 1 year ago

JaneStuart-Smith commented 1 year ago

Hi Michael, I really hope you're well! Melanie Lancien who's a new postdoc, brave enough to work on SPADE, is trying to install polyglotdb on her windows laptop. She's hit a problem - this is what's she's done so far (all relating to the instructions on https://polyglotdb.readthedocs.io/en/latest/getting_started.html#installation )

  1. pip install polyglotdb [she has python installed and working on her laptop] - this didn't work, i.e. pgdb command doesn't work
  2. second option, downloaded polyglotdb from GitHub and then tried pip install -r requirements.txt and then python setup.py install. Again pgdb command didn't work.
  3. then tried the Windows instructions (her java was 19, she tried 17, but she also installed java 11 just in case), and still pgdb didn't work.
  4. then she created a conda environment and went through those commands, but then the final command (pgdb install /path/to/where/you/want/data/to/be/stored) still didn't work.

Do you have any advice for her/us on how to get it install - thanks so much

Jane and Melanie

Melanie Lancien is on GitHub - https://github.com/M-Lancien

JaneStuart-Smith commented 1 year ago

Hi again Michael, I have now replicated everything that Melanie did, but on my laptop.
Using the pip installation, polyglotdb appeared to install, but pgdb command doesn't work (java version is 11). I then tried using Anaconda, creating a conda environment as per the instructions. This seems to work better, in that the environment (polyglotdb-dev) was created without a problem, and python setup.py install resulted in polyglotdb seeming to install without a problem.
But when I try to run pgdb install (or any of the pgdb commands), this results in a pop-up window asking me which app to open in, choosing Notepad gives the attached file (I saved it as 'pgdb', which is what it called itself). Here's a screenshot of where I'm up to in the conda environment too. It feels as if I'm really close - do you have any advice as to how to get pgdb to work? with many thanks, Jane

pgdb.txt problem_pgdb_install_start

JaneStuart-Smith commented 1 year ago

Hi again Michael, I've tried something else, to try and get pgdb working. I went back to the instructions for installing via command, using pip.

The only other thing I can think is that it might be something to do with pkg_resources, or something else within the pgdb file.

Any thoughts hugely appreciated - and hopefully my trying all these different things is helpful for you.

screenshot2_pgdb_error

screenshot1_Installing_pgdb_script

Install PolyglotDB via , which will install the pgdb utility that can be run anywhere and manages a local database.

JaneStuart-Smith commented 1 year ago

And just my final thought - I now realize that the pgdb file is a function/script (sorry steep learning curve here!). I'm assuming that polyglotdb==1.2.1 is OK (installed), which leaves pkg_resources as a possible source of the problem.
There is a folder 'pkg_resources' amongst the PolyglotDB-main files. But this page: https://setuptools.pypa.io/en/latest/pkg_resources.html tells me that:

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Do I need to download a version of importlib_resources, and put that somewhere (? in C:\PolyglotDB-main\PolyglotDB-main\Lib\site-packages), and then edit pgdb? I'm a bit wary of starting to seriously interfere with the inner workings of polyglotdb without advice :-)

michaelhaaf commented 1 year ago

Hi Jane and Melanie, hope you're both doing well! I'm currently on a vacation but I should be able to poke around to see what's going on within a week. Thanks for providing the logs and thought process in the meantime.

To start, just to clarify:

JaneStuart-Smith commented 1 year ago

Hi Michael, thanks very much for replying, and sorry to bother you on your holidays!

thanks so much - we look forward to what you come up with.

Jane and Melanie

JaneStuart-Smith commented 1 year ago

successful_pgdb_install_start_I_think Hi Michael,

There is a possibility that I've cracked it (thanks to Massimo Lipari, student of Morgan's).

Here's what I did:

We'll confirm tomorrow, but I think I might have managed it :-)

JaneStuart-Smith commented 1 year ago

Good news all - we managed to get the first step of the tutorial working, i.e. we imported a little corpus, and ran the basic queries, i.e. tutorial 1 first steps.
The only issue was that the tutorial corpus wasn't available for download (so we made a little one ourselves).