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

TypeError: 'JavaPackage' object is not callable #388

Open
dmib opened this issue Aug 12, 2019 · 1 comment
Open

TypeError: 'JavaPackage' object is not callable #388

dmib opened this issue Aug 12, 2019 · 1 comment

Comments

@dmib
Copy link

dmib commented Aug 12, 2019

After the installing pyverdict with Miniconda - that error happened after launching app.

  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\__init__.py", line 49, in redshift
    return redshift_context(host, port, dbname, user, password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\__init__.py", line 52, in redshift_context
    return VerdictContext.new_redshift_context(host, port, dbname, user, password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 150, in new_redshift_context
    instance = cls(connection_string, user=user, password=password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 70, in __init__
    verdictdbtempschema,
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 340, in _get_context
    verdictdbtempschema,
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 369, in _get_verdict_options
    verdict_options = gateway.jvm.org.verdictdb.commons.VerdictOption()

Env: Win10
C:\Workspace\Miniconda3\python.exe --version Python 3.7.3

row verdict_jar_path = self._get_verdict_jar_path()
returns
C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdict_jar\verdictdb-core-0.5.9-jar-with-dependencies.jar

but that code works:
from py4j.java_gateway import JavaGateway
gateway = JavaGateway.launch_gateway(classpath="C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdict_jar\verdictdb-core-0.5.9-jar-with-dependencies.jar")
verdict_options = gateway.jvm.org.verdictdb.commons.VerdictOption()
print(verdict_options)
output: org.verdictdb.commons.VerdictOption@7bd716c9

@erhuanlnna
Copy link

I have also met such problem. The issue is because the automatically generatated classmath in verdictDB is designed for linux systems, where the multiple paths are connected by ":", instead of ";". In such case, directly using the JavaGateway.launch_gateway function will encounter the error. You can change the ":" as ";" in the verdictcontext.py file to ensure that the verdict_options instance can be successfully initialized.

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