Copy DLL to Python site packages

未關閉
#187 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
cmake, cpp, python
領域
build-system

研究方向

從 setup.py 和 CMakeLists.txt 開始,接著重現 pip install . 和 Python 匯入流程,以檢查哪些檔案會與 .pyd 一起安裝。當所需的 DLL 與擴充功能一起安裝後,模組無需手動複製即可成功匯入時,工作就完成了。

由索引模型根據 Issue 內容生成。

描述

Hi everybody,
I created a project based on this example. What my project basicaly does, is fetching data from an API. The API consists of a .lib, .h and .DLL file. I included the .h file in my CPP code and added the .lib via target_link_libraries in CMakeLists.txt.

After running pip install . the .pyd file gets copied to site packages, but after an import in python it fails because of the missing .DLL

I solved the problem by copying the DLL next to the pyd under site packages, but would like to automate this process. What would be the best way, to accomplish this?

I already tried adding package_data to setup.py without success.

主要語言
C++
星號
671
分支
220
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pybind/cuda_example 的其他 Issue

查看 pybind/cuda_example 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。