tdegeus / pybind11_examples

Examples for the usage of "pybind11"
MIT License
633 stars 89 forks source link

If I used it in conda env, ModuleNotFoundError: No module named 'example' #3

Closed ZhangXinNan closed 5 years ago

ZhangXinNan commented 5 years ago

How to resolve it ?

tdegeus commented 5 years ago

Hi @ZhangXinNan Can you give a bit more information? Which example did you compile? How did you compile?

ZhangXinNan commented 5 years ago

@tdegeus I have resolved it. https://blog.csdn.net/sdlypyzq/article/details/102868602

cmake -DPYTHON_LIBRARY=/Users/zhangxin/anaconda3/envs/py36_pytorch041/lib/libpython3.6m.dylib \
    -DPYTHON_INCLUDE_DIR=/Users/zhangxin/anaconda3/envs/py36_pytorch041/include/python3.6 \
    -DPYTHON_EXECUTABLE=/Users/zhangxin/anaconda3/envs/py36_pytorch041/bin/python3.6 \
    ..
tdegeus commented 5 years ago

Great @ZhangXinNan !