334 questions
Score of 1
1 answer
80 views
Trying to build Python extension (module) with Dlang and pyd with dub + ldc2
I am trying to build a Python extension (module) with D and the pyd (https://github.com/ariovistus/pyd) and dub and ldc2 compiler on Windows.
I have the following dub.sdl:
name "hello"
...
Score of 1
0 answers
97 views
How to programmatically set a default Jupyter kernel in VSCode integration tests?
We're developing a VSCode extension that works with Jupyter notebooks and need to run integration tests in CI/CD. The main issue is that when running integration tests, VSCode prompts the user to ...
Score of 0
1 answer
261 views
Compilation Error installing pyo on mac os x on m3
I'm puzzled by the following issue. I have a Mac M3 with the following characteristics.
I have Python 3.12.6. I have been trying to install pyo (https://pypi.org/project/pyo/1.0.1/). After many ...
Score of 0
0 answers
102 views
Right way to avoid multiple definition error when building Python C++ extension with MSVC BuildTools
A python C++ extension has the following structure:
/myextension
|_____basecode
| |__header.h
| |__functions.cpp
|
|_____utilities
| |______utilities.h
| |...
Score of 1
0 answers
269 views
How to wrap a PyDict in PyO3 with a constructor that takes a new parameter?
I am using PyO3 (v0.22.2) / Rust to write something a little similar to defaultdict, but with an integer default rather than a callback:
>>> from my_package.pyo3_ext import PyDefaultDict
>...
Score of 0
0 answers
48 views
Gecode Attribute Not Available In Phonenumbers Geocoder Library
I am working on PYCharm IDE application for getting address from latitude and longitude and I have also installed phonenumber and geocoder library to the project in PYCharm IDE but unfortunately ...
Score of 1
0 answers
58 views
Python C++ extension DLL is not imported in python interpreter
I have written a Python extension in C/C++ to wrap my code for Python.
I followed CPython documentation in the parts of C/C++ functions each module should provide
For example, my module contains:
/* ...
Score of 2
0 answers
52 views
Python C Extension When to Free Internal Free List?
Some Python objects - for example, instances of int, float and dict - use a free list to speed up allocations. The C API provides methods to clear such free lists.
By hardcoding PyXXX_ClearFreeList ...
Score of 0
0 answers
279 views
Python C Extension - Access to PyInterpreterState Internal Data Structure
I recently found that I could get the Python interpreter state by PyInterpreterState_Get() C-API. However, when I tried to access its members defined by struct _is in the extension code, during the ...
Score of 0
1 answer
98 views
How to properly deepcopy linked objects in C Extension
In Python, I have a pair of classes like
class Internal:
def __init__(self, ref):
self.ref = ref
class External:
def __init__(self):
self.storage = [1,2,3]
self.int = ...
Score of 2
1 answer
165 views
Understanding memory leak with C++ extension for python
I have been struggling to understand what I am doing wrong with the memory management of this this C++ function for a python module, but I don't have much experience in this regard.
Every time I run ...
Score of 3
0 answers
571 views
How do you tell setuptools to build an extension for --debug when using pyproject.toml / PEP 518
I have created a Python project with a C++ extension using pyproject.toml (PEP 518, PEP 517, PEP 621, PEP 660, etc.). I'm sure I could be doing some things better, but generally speaking it's working ...
Score of 1
1 answer
477 views
No module named 'pybind11' when using poetry
Used pybind11 in the past without issue pulled in as a submodule and used via cmake. Now working on another project that uses poetry, and so wanted to make everything poetry-centric.
Trying to build ...
Score of 2
2 answers
11267 views
"The Pylance server crashed 5 times in the last 3 minutes"? (circa v2023.10.40 of the Pylance VS Code extension)
Every time I launch VS code, the Pylance server crashes 5 times in in 3 minutes, or so the output terminal says. The server stops trying to relaunch and I lose out on a handful of features as a result....
Score of 0
0 answers
550 views
cannot activate the 'ros' extension because it depends on an unknown 'ms-vscode.cpptools' extension. on code server
So I was trying to learn ROS2 iron on the Ubuntu Server. I installed the Ubuntu server on a Raspberry Pi 4 and I used my laptop to SSH into the Raspberry Pi 4. Next, I installed ROS2 iron on the ...