SPARQL-Anything / PySPARQL-Anything

The SPARQL Anything Python library
Apache License 2.0
13 stars 2 forks source link

Can't install/import on Windows #7

Closed jmmcd closed 1 year ago

jmmcd commented 1 year ago
PS D:\vc\patterns-knowledge-graph\patterns-knowledge-graph-datasets\RDF> pip install pysparql-anything
Collecting pysparql-anything
  Downloading pysparql_anything-0.8.1.1-py3-none-any.whl (11 kB)
[etc etc]
Successfully installed Deprecated-1.2.14 pygithub-2.1.1 pyjnius-1.6.0 pyjwt-2.8.0 pynacl-1.5.0 pysparql-anything-0.8.1.1 typing-extensions-4.7.1
WARNING: There was an error checking the latest version of pip.
PS D:\vc\patterns-knowledge-graph\patterns-knowledge-graph-datasets\RDF> ipython
In [1]: import pysparql_anything as cli
No SPARQL Anything jar has been found in the installation folder.
Downloading the latest SPARQL Anything jar, please wait...
Downloading SPARQL Anything v0.8.2: 100%|██████████████████████████████████████████████████████████████████████| 198M/198M [00:29<00:00, 7.11MiB/s]
The Download was successful!
The system is now ready for use!
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pysparql_anything\engine.py in <module>
     10     jnius_config.set_classpath(get_path2jar())
---> 11     from jnius import autoclass, JavaException
     12 except ValueError:

~\AppData\Local\Continuum\anaconda3\lib\site-packages\jnius\__init__.py in <module>
     43 else:
---> 44     from .jnius import *  # noqa
     45     from .reflect import *  # noqa

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

NameError                                 Traceback (most recent call last)
<ipython-input-1-1ac4a47f8b5f> in <module>
----> 1 import pysparql_anything as cli

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pysparql_anything\__init__.py in <module>
     27     raise
     28 # Launches the JVM
---> 29 from pysparql_anything.sparql_anything import SparqlAnything

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pysparql_anything\sparql_anything.py in <module>
      5
      6 import pysparql_anything.command as cmd
----> 7 from pysparql_anything.engine import Engine
      8
      9

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pysparql_anything\engine.py in <module>
     15           + 'create a new VM for the  CLI.')
     16     raise
---> 17 except JavaException:  # Handles JVM exception for an incorrect path
     18     print('JVM exception occured: \n'
     19           + 'Check the jar has been dowloaded succesfully:\n'

NameError: name 'JavaException' is not defined
MarcoR1791 commented 1 year ago

Hi James, I have unfortunately been unable to replicate this issue as I have successfully installed the module on my own Windows machine and a virtual machine.

I will though try and investigate this further.

In the mean time, could you please check the version of Python that you have installed on your machine and let us know if updating it perhaps fixes the issue?

Marco

jmmcd commented 1 year ago

Fixed by upgrading from py 3.7 to 3.11.