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

Cannot use pip module. #72

Open
NeevJewalkar opened this issue Oct 20, 2024 · 2 comments
Open

Cannot use pip module. #72

NeevJewalkar opened this issue Oct 20, 2024 · 2 comments

Comments

@NeevJewalkar
Copy link

Ive tried using the following example:

import { pip } from "https://deno.land/x/python/ext/pip.ts";

const np = await pip.import("numpy");
const plt = await pip.import("matplotlib", "matplotlib.pyplot");

const xpoints = np.array([1, 8]);
const ypoints = np.array([3, 10]);

plt.plot(xpoints, ypoints);
plt.show();

and in the terminal i get:

(bunpytest) ➜  bunpytest deno run -A --unstable-ffi index.js
Installing numpy
WARNING: Target directory /Users/neevjewalkar/Library/Caches/deno/plug/pip/numpy already exists. Specify --upgrade to force replacement.
WARNING: Target directory /Users/neevjewalkar/Library/Caches/deno/plug/pip/numpy-2.1.2.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /Users/neevjewalkar/Library/Caches/deno/plug/pip/bin already exists. Specify --upgrade to force replacement.
error: Uncaught (in promise) PythonError: 0  File "<frozen runpy>", line 229, in run_module
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/__main__.py", line 24, in <module>
    sys.exit(_main())

@elimydlarz
Copy link

I had the same issue and gave up on using Pip in code - just working around by using pip CLI independently of the bridge.

@NeevJewalkar
Copy link
Author

can you elaborate please?

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