Comments (6)
when loading a package even for packages that don't need to be downloaded.
The package numpy is a part of the default distribution.
No. This is not true. NumPy is not included in the default distribution. Actually, we don't include any wheels in the npm package to reduce the size of the npm Pyodide package. Check the node_modules/pyodide
directory.
Instead, we download packages on the fly in Node.js and store them in the node_modules directory (Code Pointer). So I guess that's why Deno is requesting a write access.
This is not an ideal situation, but we don't want to host hundreds of megabytes of packages in a single npm package.
from pyodide.
@ryanking13 Oh, right, don't know why I thought numpy
was included, it's indeed cached in the node_modules
folder.
But the point still stands -- even when no changes are needed, write access is requested, which does not make sense.
I think the culprit is some needless mkdir, given that the request is for Deno.mkdir
. Most likely there's some code that creates a folder in order to ensure that the folder exists, which prompts for the write permission.
Eg. something like this:
create_folder(folder)
do_something_with_folder(folder)
...should be changed into this
if not exists(folder):
create_folder(folder)
do_something_with_folder(folder)
from pyodide.
@ryanking13 I found the offending line:
pyodide/src/js/load-package.ts
Line 258 in 6542047
Patching it out fixes the problem:
Adding a check here if the folder exists would prevent Deno from needlessly asking for permission. Sorry for not sending a full PR, I'm not very proficient with Node.js
from pyodide.
Oh, I see. That makes sense. Thanks for the detailed information @JanPokorny! I'll see if I can fix it by checking the existence of the path first.
from pyodide.
from pyodide.
That's great, thank you @whitphx !
from pyodide.
Related Issues (20)
- request to add llama-index
- request to add langchain HOT 1
- request to add Boto3 HOT 4
- fastobo
- loadPackage() not to access the file system if the cache already exists HOT 2
- cvxpy-base 1.4.3 HOT 2
- html5_canvas_backend no longer works. HOT 1
- RFC Package unvendored stdlibs to sdist / wheel? HOT 3
- `make` in docker container `pyodide/pyodide-env` fails with `could not create work tree dir 'emsdk'` HOT 8
- DOM types in pyodide lead to build issues with Angular and typescript. HOT 3
- Request add to section-properies package
- feat: Resolving CORS Restrictions in Node.js HOT 2
- please make it work like normal python HOT 1
- STATUS_BREAKPOINT on Microsoft Edge HOT 1
- NextJS build fails with webpack error due to Pyodide import HOT 1
- `OSError: [Errno 8] Bad file descriptor` when trying to save `.npy` files HOT 1
- `pyodide build -h` should print help text HOT 1
- dependcy for open-interpreter HOT 6
- `crc32c` HOT 4
- `zstandard` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodide.