problem installing polyglotdb on windows laptop
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 )
- pip install polyglotdb [she has python installed and working on her laptop] - this didn't work, i.e. pgdb command doesn't work
- 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.
- 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.
- 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
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
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.
- I navigated to inside the
PolyglotDB-Maindirectory - I'd already run these lines before to install PolyglotDB:
pipinstall -rrequirements.txt, then 'python setup.py install'. - But I ran them again, and looked to see if they mentioned if
pgdbhad been installed - and if you look at screenshot1, you can see the line:Installing pgdb script to C:... - However when I attempt any
pgdbcommands, likepgdb installorstart, the error message is as screenshot2 - I then had a look in the Scripts folder, and found the
pgdbfile. This is exactly what conda was asking me to open - and which I posted as a text file. - I wondered if the problem is because
pgdbisn't a.pyfile, so added a.pyextension. But that didn't work - Then I moved
pgdbas it was (extensionless) out of Scripts into PolyglotDB-main, in case the issue was that the file couldn't be located. That didn't work. - Then I tried with
pgdb.py, and than didn't work.
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.
Install PolyglotDB via , which will install the pgdb utility that can be run anywhere and manages a local database.
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 :-)
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:
- are you intending to just run and use polyglotdb? Or to contribute to polyglotdb (write and push new code)?
- this is all on Windows 11 machines?
Hi Michael, thanks very much for replying, and sorry to bother you on your holidays!
- yes, the plan is to run and use polyglotdb, to run existing scripts, and edit them to take new queries.
- we're both running Windows 10 machines (I;ve not dared to shift to Windows 11, as I've not heard good things about the transition)
thanks so much - we look forward to what you come up with.
Jane and Melanie
Hi Michael,
There is a possibility that I've cracked it (thanks to Massimo Lipari, student of Morgan's).
Here's what I did:
- navigated to \Scripts directory, where
pgdbscript is - first I tried
python pgdb install- this did attempt to installpgdb, but complained about there being nowin32com - so I navigated to the second polyglotDB-main directory and ran
pip install pypiwin32 - then I went to \Scripts directory, and ran
python pgdb install- and I believe that pgdb was installed successfully - see screenshot (plus Windows asked my permission a couple of times to allow software to be installed) - - then, also in the \Scripts directory, I ran:
python pgdb start, and that is also included in the screenshot - I believe pgdb did start (and another command window opened). - it's pretty late here now, so we'll go through the tutorial tomorrow - so I then ran 'python pgdb stop' and I got the message:
stopping Neoj4.......... stopped.
We'll confirm tomorrow, but I think I might have managed it :-)
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).