Skip to content

Cant depend on ngsolve when using pyinstaller or pyoxidizer #53

@GlennWSo

Description

@GlennWSo

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions