python-extensions Questions

6

Solved

I may have messed up some environmental path variables. I was tinkering around VS Code while learning about Django and virtual environments, and changing the directory path of my Python install. Wh...
Unwilled asked 16/11, 2022 at 22:11

5

Solved

I'm creating a C++ extension for python. It creates a module parent that contains a sub-module child. The child has one method hello(). It works fine if I call it as import parent parent.child.hell...
Jawbone asked 10/5, 2023 at 20:41

1

Solved

Background I have an anaconda environment that has Python 3.7 installed. I have a file with some imports out of order which I want VScode to order when pressing CRTL+s. However, instead or ordering...
Wulfenite asked 15/10, 2021 at 14:6

1

Solved

I'm working on a Python C extension and I would like to expose a custom enum (as in: a class inheriting from enum.Enum) that would be entirely defined in C. It turned out to not be a trivial task a...
Averyaveryl asked 22/7, 2021 at 18:56

1

I'm trying to create and distribute (with pip) a Python package that has Python code, and C++ code compiled to a .pyd file with Pybind11 (using Visual Studio 2019). I also want to include .pyi stub...
Doralynn asked 24/1, 2021 at 22:55

9

Solved

I have just compiled part of my C library as an extension using Cython, as a "proof of concept". I managed to hack the code (const correctnes problems etc aside), to finally get an extension built....
Burks asked 6/11, 2011 at 2:21

6

I have been trying to install Cython for Python 2.7 on my Window 7 system. In particular, I prefer everything in 64 bits. (In case you wonder, I need Cython because Cython is one of the components ...
Misdate asked 16/5, 2014 at 2:8

3

Does pip install always build extension modules with the same compiler that was used to compile the current Python version? For example, this blog post explained that numpy package uses C code, whi...
Granoff asked 18/3, 2019 at 9:27

2

Solved

How can I create a Python C extension wheel for MacOS that is backwards compatible (MacOS 10.9+) using MacOS 10.15? This is what I have so far: export MACOSX_DEPLOYMENT_TARGET=10.9 python -m pip...
Borrero asked 27/2, 2020 at 12:11

1

Solved

I'm building a C Python extension which makes use of a "third party" library— in this case, one that I've built using a separate build process and toolchain. Call this library libplumbus....
Barnie asked 9/9, 2020 at 4:42

2

Solved

When I execute a command python setup.py install or python setup.py develop it would execute build_ext command as one of the steps. How can I pass --debug option to it as if it was invoked as pytho...
Nutrilite asked 9/5, 2020 at 6:57

1

Solved

In a nutshell I try to compile a cython extension called extension2 that cimports a file extension from a self-created package. When building extension2, I get the error that extension.pxd is not...
Opinion asked 31/12, 2019 at 15:8

0

I'm developing a C(++) extension for python. I have a library in C that I wrap using Swig. Unfortunately I have some error that I would like to debug that is within the C extension. My program make...
Panathenaea asked 22/8, 2019 at 15:17

1

Solved

Experimentally, I verified that when a compiled extension.pyd (or .so) and plain extension.py both exist in the same directory, the .pyd file gets imported first ; the .py is only imported if the ....
Schaaf asked 6/5, 2019 at 12:6

4

Solved

We've been long-time fans of pylint. Its static analysis has become a critical part of all our python projects and has saved tons of time chasing obscure bugs. But after upgrading from 1.3 -> 1.4, ...
Rigid asked 10/2, 2015 at 16:44

3

I'm writing a C extension for a python application, and need to test python-specific C code. To do so I need to import Python.h into my C files, but for the life of me I haven't been able to do tha...
Barramunda asked 24/6, 2014 at 16:38

1

Solved

I have a function foo in a Python Extension Module that should return a tuple of ints to Python. This can be easily done using Py_BuildValue: static PyObject* foo(PyObject* self, PyObject* args) ...
Eggleston asked 5/9, 2018 at 7:45

1

Solved

I build a compiled Python extension (.pyd file) with C++ and pybind11. I would like to generate a single Python interface .pyi file for my .pyd file. There are a few similar questions referring to...
Linn asked 27/6, 2018 at 7:55

1

Solved

I am building a Python extension (.pyd) using Visual Studio 2015 C++ project and Python 2.7 32bit. This is my .cpp file: #include <Python.h> static PyObject* GetTwoInts(PyObject* self, PyO...
Interleave asked 3/6, 2018 at 17:13

3

Solved

I've written a Python module that depends on some C extensions. Those C extensions depend in turn on several compiled C libraries. I'd like to be able to distribute this module bundled with all the...
Jessjessa asked 31/10, 2017 at 18:41

2

So I needed to use the code of the subprocess module to add some functionality I needed. When I was trying to compile the _subprocess.c file, it gives this error message: Error 1 error C2086: 'PyT...
Demakis asked 25/1, 2017 at 21:31

2

Solved

Two sections of Python 2.7's documentation mentioned adding cyclic garbage collection (CGC) support for container objects defined in extension modules. The Python/C API Reference Manual gives two r...

3

Solved

I want to create a function in C that extends Python that can take inputs of either float or int type. So basically, I want f(5) and f(5.5) to be acceptable inputs. I don't think I can use if (!Py...
Leftwich asked 4/10, 2016 at 4:19

1

Solved

Using SWIG to build python extensions (xxx.so) is easier than distutils. You don't need to write a wrap.c program to wrap your original c program. So I'd like using SWIG than Distutils. But There i...
Sackey asked 30/6, 2016 at 14:7

2

Solved

I am attempting to write a C extension for python. With the code (below) I get the compiler warning: implicit declaration of function ‘Py_InitModule’ And it fails at run time with this error: u...
Rhigolene asked 3/2, 2015 at 18:5

© 2022 - 2024 — McMap. All rights reserved.