-
Notifications
You must be signed in to change notification settings - Fork 2
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
adder.py needs to be in the current working directory #2
Comments
Hey, this is a good question. I'm working on adding a couple of examples to the repo to show how to do this correctly. I will update you when they are ready! |
The short answer is that you could set the The longer answer....So I added some examples that may help you out. This one in particular has some modules that it's importing (https://github.com/mooreryan/ocaml_python_bindgen/tree/main/examples/importing_modules). The readme in there is fairly detailed, so hopefully it will help. Oh and as a bonus, the dune files shows how to set up dune rules to automatically generate the bindings when your specs are updated. If you need more help, let me know. Otherwise, feel free to close the issue! |
Better answer, I asked to @thierry-martinez: let toto = Py.Import.import_module "toto" Now, combine this with mirage/ocaml-crunch, and we can have an ocaml library/executable |
I saw that issue on the pyml repository as well. Yes that is correct that you need to use However, it doesn't change the fact that you will need to let Python know how to actually find the module. The simplest way to do that is probably with the (Perhaps I'm misunderstanding your question...?) |
(But yes embedding the python file in the executable somehow would be very cool....) |
ok, PYTHONPATH would be the basic way, so if should let opam install the python file somewhere and then reflect |
Sorry for the confusion...let me try an explain it a different way in case others have the same question as well. If you have a python package installed in the "normal" way...say If you want to use a python module not installed with pip, conda, or whatever (e.g., just in some folder in your |
No problem, this is what I got from your explanations. |
or you get this kind of error:
Is there a way I can install this python file somewhere else, but so that
it could still be found at runtime?
The text was updated successfully, but these errors were encountered: