Open crabhi opened 5 years ago
Issues with __file__
are issues with the 3rd party Python package. See #69 for more details.
We already have an issue on file for certifi
(#73). I also believe there's another issue floating around for problems with pytz
...
Thanks for your response. I've missed the issue #69. I'm not sure if this particular problem falls under that umbrella, though.
I tried to patch certifi
and pytz
locally. I was using pkgutil
but I didn't get any data.
I've tried it also with a clean build:
pyoxidizer init test
pip-install-simple
rule to pyoxidizer.toml
with the certifi
package.cacert.pem
from certifi
with any of pkgutil
, pkg_resources
or importlib.resources
. It doesn't work. If I install certifi
into an empty Python virtualenv without PyOxidizer, all of the methods give me the data.If you feel #69 is more appropriate for this discussion, I'll move it there. If you have any pointers to how to load such bundled file, it would be much appreciated.
Hi, this tool looks very good. I'm trying to package my first app. Unfortunately, it depends on
certifi
andpytz
.I can't find a way to access the files bundled with the modules.
I've tried:
pkgutil.get_data('certifi', 'cacert.pem')
->None
importlib.resources.read_binary('certifi', c 'cacert.pem')
->FileNotFoundError: Package has no location <module 'certifi' (<PyOxidizerFinder object at 0x7fd94a6bb558>)>
import pkg_resources
->ModuleNotFoundError: No module named 'pkg_resources'
I haven't tried the
__loader__
method yet because it means I have to fork the dependencies. At least withcertifi
, I thought I could monkey-patch it.I donl't like much the
app-relative:lib
install location because that complicates the distribution and updates of the app.