pybind / pybind/cuda_example

Copy DLL to Python site packages

Open
#187 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
670
Forks
219
Avg merge
8d 2h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup.py and CMakeLists.txt, then reproduce the pip install . and Python import flow to inspect which files are installed alongside the .pyd. The work is complete when the required DLL is installed with the extension so importing the module succeeds without manual copying.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.