Questions tagged [python-extensions]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

323 questions
0
votes
1 answer

How does attaching to a process work in VS Code debugger extensions?

I am trying to understand what happens / is supposed to happen when I attach to a process with a debugger in VS Code. I understand that I can create attach launch configurations in VS Code, and when I do this and start the debug configuration, I can…
Samufi
  • 2,465
  • 3
  • 19
  • 43
0
votes
0 answers

Get the (C) size of a (C) type in a Python extension

I'm writing a C extension for Python and need to pass the size of a C type to the compilation. So I'll want to do extra_compile_args = ['-DSIZEOF_MYTYPE=32'] in my setup.py. My question is: how can I get the size? (32 here) If my target were pure…
jjg
  • 907
  • 8
  • 18
0
votes
0 answers

How to install python extension "ms-python.python" in local linux server to debug the scrip in VScode

I ssh the server in VS code and when I install python extension in the VScode, I got "Error: unable to get local issuer certificate". May I know how can I install python extension in the linux server manually? Because I want to debug the script in…
Susan
  • 431
  • 1
  • 4
  • 16
0
votes
0 answers

"Error: Corrupt zip" issue stopping many VSCode extensions from installing

System: Windows 10 Computer: HP EliteBook 850 G7 Notebook PC VSCode version: 1.74.3 Extension that demonstrates issue: ms-python.python-2022.20.2 The behavior I need to fix: When I tried to install the Python extension from the GUI I get an error…
user137698
  • 291
  • 2
  • 12
0
votes
1 answer

How does VSCode's Python Extension use the Paths you set?

I'm troubleshooting an issue with VSCode's Python extension trying to load the wrong version of Python. I'd like to know how this extension uses the Path variables you give it in its settings. For example, see the picture below: Intuitively, I…
Connor
  • 867
  • 7
  • 18
0
votes
0 answers

Nested extension module cannot be imported

I am trying to import an extension module contained inside a nested package. For the purposes of this example, it's the only element of the root module, but the real case has others. When I attempt to test the following module setup using tox (or…
0
votes
1 answer

std::cout error when using METH_VARARGS or METH_VARARGS | METH_KEYWORDS

I have created a python extension with C++. Generally, it works fine, and I can use the extension from Python to call C++ functions. When I define a method using the METH_O or METH_NOARGS macros, the method is able to call cout << [something] <<…
0
votes
1 answer

PyPy memory leak with custom C++ extension?

I am trying to write a C++ extension with support for CPython and PyPy. My extension involves creating some custom types that support the call interface. However, I appear to be getting memory leaks in PyPy when I raise Python exceptions. I am not…
Lalaland
  • 119
  • 1
  • 2
0
votes
0 answers

Compile full package with nested modules using numba Ahead-of-Time Compilation

I split up my numerical code into multiple modules, which all are part of a package. I would like to completely pre-compile the full package. The documentation just gives information on [how to compile a single module], but not a package with…
0
votes
0 answers

numpy C-API extension fails to compile in separated file

Currently writing a C extension for Python, I successfully compiled and use the numpy C-API within the main/loader file of the module extension. I am now trying to move the logic into a different C file. Following the documented procedure, I set up…
G.Launay
  • 33
  • 7
0
votes
0 answers

Create pip-installable package with C extension pulled from Github

I have a python library that I'm trying to package into something pip-installable. It depends upon a C library (shoco). I'd like to avoid packaging the actual source code to shoco in my own package if possible. I found a solution here, but it seems…
Mala
  • 14,178
  • 25
  • 88
  • 119
0
votes
0 answers

Visual studio Python extension mixed mode debugging on CMake project

I'm trying to create a C++ Python extension using pybind11 and CMake, and would like to take advantage of visual studio's mixed mode debugging (see) for developing the extension. I tried following the MSDN guide, and was able to create an extension…
osbt1
  • 1
0
votes
0 answers

Debugging Python Extensions written in C

I'm pretty familiar with writing C code and I'm comfortable in writing python code. I'm trying to learn how to write modules in C that can be called from Python-3.9.X on OSX 10.15.7. I've gotten a couple 'hello world' type of examples to work, but…
irritable_phd_syndrome
  • 4,631
  • 3
  • 32
  • 60
0
votes
0 answers

How to get the arguments for a Python c-extension function?

I'm working on a project that runs in a Python environment with numerous C extensions included that are used to interface with the software that the project runs under. Unfortunately, the documentation for some of these functions is either incorrect…
Miguel Guthridge
  • 1,444
  • 10
  • 27
0
votes
1 answer

how does python package links to dll (.so) files

I am creating a python package based on this repo. The package has few cpp files which are compiled when I build the package using setup.py and running pip install . This generates _C.cpython-36m-x86_64-linux-gnu.so file in my package installation…