About Anaconda Help Download Anaconda

conda-forge / packages / cppimport 26.4.17

Import C++ directly from Python!

copied from cf-post-staging / cppimport

Installers

  • noarch v26.4.17

conda install

To install this package run one of the following:
conda install conda-forge::cppimport

Description

Sometimes Python just isn't fast enough. Or you have existing code in a C or C++ library. So, you write a Python extension module, a library of compiled code. I recommend pybind11 for C++ to Python bindings or cffi for C to Python bindings. I've done this a lot over the years. But, I discovered that my productivity is slower when my development process goes from Edit -> Test in just Python to Edit -> Compile -> Test in Python plus C++. So, cppimport combines the process of compiling and importing an extension in Python so that you can just run import foobar and not have to worry about multiple steps. Internally, cppimport looks for a file foobar.cpp. Assuming one is found, it's run through the Mako templating system to gather compiler options, then it's compiled and loaded as an extension module.


© 2026 Anaconda, Inc. All Rights Reserved. (v4.2.17) Legal | Privacy Policy