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

problem installing polyglotdb on windows laptop #180

Open
JaneStuart-Smith opened this issue Mar 8, 2023 · 7 comments
Open

problem installing polyglotdb on windows laptop #180

JaneStuart-Smith opened this issue Mar 8, 2023 · 7 comments

Comments

@JaneStuart-Smith
Copy link

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
Copy link
Author

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
Copy link
Author

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-Main directory
  • I'd already run these lines before to install PolyglotDB: pip install -r requirements.txt, then 'python setup.py install'.
  • But I ran them again, and looked to see if they mentioned if pgdb had been installed - and if you look at screenshot1, you can see the line: Installing pgdb script to C:...
  • However when I attempt any pgdb commands, like pgdb install or start, the error message is as screenshot2
  • I then had a look in the Scripts folder, and found the pgdb file. 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 pgdb isn't a .py file, so added a .py extension. But that didn't work
  • Then I moved pgdb as 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.

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
Copy link
Author

JaneStuart-Smith commented Mar 9, 2023

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
Copy link
Collaborator

michaelhaaf commented Mar 9, 2023

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?

@JaneStuart-Smith
Copy link
Author

JaneStuart-Smith commented Mar 9, 2023

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

@JaneStuart-Smith
Copy link
Author

JaneStuart-Smith commented Mar 9, 2023

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:

  • navigated to \Scripts directory, where pgdb script is
  • first I tried python pgdb install - this did attempt to install pgdb, but complained about there being no win32com
  • 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 :-)

@JaneStuart-Smith
Copy link
Author

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).

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