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

Cant depend on ngsolve when using pyinstaller or pyoxidizer #53

Open
GlennWSo opened this issue Oct 17, 2022 · 0 comments
Open

Cant depend on ngsolve when using pyinstaller or pyoxidizer #53

GlennWSo opened this issue Oct 17, 2022 · 0 comments

Comments

@GlennWSo
Copy link

Im trying to create app that depends on ngsolve. My targets are both windows and linux.

I have tried using both pyinstaller pyoxidizer.
Here is my pyoxidizer attempt:

To test my that i get the depenencies working i have made a simple pyoxidzer.bzl config.
Here a link: https://github.com/GlennWSo/pyoxidzer-learn/blob/ngsolve/pyoxidizer.bzl
Bellow here is a snippet from the file:

def make_exe():
    dist = default_python_distribution(python_version="3.9")
    policy = dist.make_python_packaging_policy()
    policy.set_resource_handling_mode("files")
    policy.resources_location_fallback = "filesystem-relative:lib"

    python_config = dist.make_python_interpreter_config()
    python_config.module_search_paths = ["$ORIGIN/lib"]

    exe = dist.to_python_executable(
        name = "python-with-ngsolve",
        packaging_policy = policy,
        config = python_config,
    )

    for resource in exe.pip_download(["pyvista", "ngsolve"]):
        resource.add_location = "filesystem-relative:lib"
        exe.add_python_resource(resource)

    return exe

What i expect when i enter "pyoxidzer run" is a python shell where i can import ngsolve and pyvista.
but what happens:

foo@bar:~ $ pyoxidizer run
printing lots of info...
...
Python 3.9.13
Type "help" to ...
>>> import pyvista
>>> print(pyvista.__version)
0.36.1
# pyvista package is working :)

>>> import ngsolve
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'ngsolve'
# :(

Any help would be much appreciated!

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

1 participant