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

[ERROR] OSError: [Errno 30] Read-only file system: 'lib' #294

Open
pei-lin-ml opened this issue Jul 26, 2024 · 1 comment
Open

[ERROR] OSError: [Errno 30] Read-only file system: 'lib' #294

pei-lin-ml opened this issue Jul 26, 2024 · 1 comment

Comments

@pei-lin-ml
Copy link

https://github.com/WestHealth/pyvis/blame/ccb7ce745ee4159ce45eac70b9848ab965fc0906/pyvis/network.py#L519

This hard coding prevents execution in AWS lambda function. Stack trace:
[ERROR] OSError: [Errno 30] Read-only file system: 'lib' Traceback (most recent call last): File "/var/task/lambda_function.py", line 101, in handler plot_graph_for_originator(df, originator) File "/var/task/lambda_function.py", line 53, in plot_graph_for_originator nt.save_graph(f"/tmp/{html_file}") File "/var/lang/lib/python3.11/site-packages/pyvis/network.py", line 438, in save_graph self.write_html(name) File "/var/lang/lib/python3.11/site-packages/pyvis/network.py", line 519, in write_html os.makedirs("lib") File "<frozen os>", line 225, in makedirs

Instead of hard coded lib, it should take the output dir from the designated output file, in the lambda function case it is /tmp.

@FlxVctr
Copy link

FlxVctr commented Sep 25, 2024

Used it in another context than AWS lambda (Beeware framework), but got this fixed by adding the argument by changing cdn_resources from its standard value ('local')

net = Network(notebook=False, cdn_resources="in_line")

Then it switches to @pei-lin-ml's desired behaviour:

elif self.cdn_resources == "in_line" or self.cdn_resources == "remote":

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

2 participants