-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy DLL to Python site packages #187
Comments
I'm not super familiar with this system and learning it myself, but is this something that |
I would highly recommend using pybind/scikit_build_example. This is the old way to do things, and is much harder to use and prone to breaking with every setuptools release. There you should be able to install the .DLL ( |
Hello @technikamateur I have a similar problem. The file "example.cp310-win_amd64.pyd" is generated. Which .dll did you place near the .pyd file? |
The .dll of the libraries I am using in my C code. |
And thanks @henryiii . I will look into it. So there is no way to do it with this project? |
You should be able to use CMake to copy the DLL in the right spot. Though cmake does some path fixing when it installs, which this project doesn't include, but if you are manually copying it and it works, you should be able to copy it with CMake too. |
Hello again When I generate the .pyd file with VSCODE on a computer with Visual Studio 17 2022, the generated example.pyd can easily be imported from Python scripts. The log printed during examle.pyd generation is like below:
I am still not sure that pybind11 is compatible with VSCODE usage. I can share the VSCODE project if needed. |
Hello Now .pyd generation and .pyd import give no error. |
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 .DLLI 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.
The text was updated successfully, but these errors were encountered: