subpar icon indicating copy to clipboard operation
subpar copied to clipboard

subpar not working with psycopg2 dependency.

Open bajacondor opened this issue 6 years ago • 2 comments

I've made a par_binary() called batch-check that has psycopg2 as a dependency. The par bundle seems to be alright but the main import cannot work out the dependencies of psycopg. This is the error I get:

File "batch-check.par/__main__.py", line 6, in <module>
  File "batch-check.par/pypi__psycopg2_2_7_4/psycopg2/__init__.py", line 50, in <module>
ImportError: No module named _psycopg

I can see pypi__psycopg2_2_7_4/psycopg2/_psycopg.so inside the par file, but it appears to be a .so shared library file. I've attached the par file as a zip here because the par file extension is not allowed on github.

Thank you for your help.

kpi-check.zip

bajacondor avatar Apr 03 '18 17:04 bajacondor

Can you add the following to your par_binary() rule and try again?

par_binary(
    ...
    zip_safe = False,
    ...
)

duggelz avatar Apr 17 '18 20:04 duggelz

~~Not OP but that gives me:~~

no such attribute 'zip_safe' in 'py_binary' rule

~~it looks like subpar is incorrectly trying to pass the zip_safe flag along to py_binary?~~

edit: Nevermind, I needed to go from 1.0.0 -> 1.3.0. This seems to fix it for me.

alecbz avatar Aug 11 '18 01:08 alecbz