question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numpy example issue

See original GitHub issue

Thanks for creating deno_python. I tried to run NumPy example but faced this issue. Could you help me to resolve this issue?

error: Uncaught (in promise) PythonError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/usr/local/bin/deno"
  * The NumPy version is: "1.22.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: dlopen(/usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): Symbol not found: _PyBaseObject_Type
  Referenced from: /usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so
  Expected in: flat namespace
 in /usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so

Traceback:
['  File "/usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/__init__.py", line 144, in <module>\n    from . import core\n', '  File "/usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/__init__.py", line 49, in <module>\n    raise ImportError(msg)\n']
  throw new PythonError(errorMessage);
        ^
    at maybeThrowError (https://deno.land/x/python@0.1.0/src/python.ts:641:9)
    at Python.importObject (https://deno.land/x/python@0.1.0/src/python.ts:717:7)
    at Python.import (https://deno.land/x/python@0.1.0/src/python.ts:727:17)
    at file:///Users/hoangpq/WebstormProjects/deno-working/server.ts:3:25

But working well on Python REPL

image

Environment: OS: macOS Python version: 3.8 (Homebrew) Deno version: 1.18.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
DjDeveloperrcommented, Jan 27, 2022

That is quite weird. I will have to debug this locally so I need some more time, sorry 😅

1reaction
hoangpqcommented, Jan 31, 2022

Tested on macOS Big Sur, Python 3.8, Deno 1.18.0, deno_python 0.1.1

image

Thanks for your help 🥇

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · numpy/numpy - GitHub
The fundamental package for scientific computing with Python. - Issues · numpy/numpy.
Read more >
NumPy Practice Problems (Solutions Explained) - YouTube
Collection of NumPy practice problems taken from my comprehensive course on NumPy (link below). Problems are ordered in increasing ...
Read more >
Python NumPy - Practice Exercises, Questions, and Solutions
Questions on NumPy Statistics · Compute the median of the flattened NumPy array · Find Mean of a List of Numpy Array ·...
Read more >
NumPy Tutorial: A Simple Example-Based Guide - Stack Abuse
The NumPy library is a popular Python library used for scientific computing applications, and is an acronym for "Numerical Python".
Read more >
NumPy quickstart — NumPy v1.24 Manual
It demonstrates how n-dimensional ( n >= 2 ) arrays are represented and can be manipulated. In particular, if you don't know how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found