boostorg / boostorg/python

numpy required for C++ library to work with python bindings

オープン
#358 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
537
フォーク
223
平均マージ
11時間 22分
マージ済み PR(30日)
2

説明

I've added Boost python bindings into a C++ library. Calling the initialization method of this C++ library from python will fail if numpy is not imported into python before importing my C++ library. There are no errors but the C++ library spits out it failed to initialize. Why would numpy be required in python for my boost bindings to work with this C++ library? See example below.

C++

```
// Boost imports I'm using
#include
#include
#include
using namespace boost;

static bool InitializePy() {
// Call library initialize here
}

BOOST_PYTHON_MODULE(test_lib)
{
python::def("initialize", InitializePy);
}
```

Python

```
# import numpy
import test_lib
# Without importing numpy, this initialization will fail
test_lib.initialize()
```

I can share more source if anyone would like a look but the way I see it, regardless of what else is being done in C++, numpy needing to be imported in python is odd to me.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。