Open icyveins7 opened 8 months ago
I am facing a similar issue in UHD 4.6.0.0-166-g041eef34, Windows 10, Python 3.10.
The libpyuhd.pyd
isn't copied into site-packages because setup.py expects a Unix *.so
file and not a windows *.pyd
file.
My workaround is to change line 32 from 'uhd': ['*.so'],
to 'uhd': ['*.so', '../path/to/Release/libpyuhd.pyd'],
so that libpyuhd.pyd
is installed into site-packages.
Issue Description
When enabling Python API during the source build, the post-build event trigger fails to properly build/copy the Python API files & libraries.
Note that the build is considered to have succeeded, but no UHD related .py files / libraries will actually be installed.
Setup Details
Source for 4.5.0.0 downloaded directly from 'Releases' page. CMake 3.27.7 Python 3.11 (Virtual environment) Visual Studio 2022 Windows 10
Expected Behavior
UHD python libraries are installed properly into the virtual environment (or somewhere at least).
Actual Behaviour
Error manifests as only a warning as above. See Additional Information for my hotfix.
Steps to reproduce the problem
Source for 4.5.0.0 downloaded directly from 'Releases' page. Build with Python API enabled.
Additional Information
The fix in this case was to simply run the post-build event myself. As seen in
host\build\python\cmake_install.cmake
, which is run as part of the post-build event, it tries to doThe outermost
INSTALL.vcxproj
attempts to do this from the outermosthost\build
folder. I stepped into thehost\build\python
folder (where there is abuild\lib
folder containing the .py files & libs), and then ran the above command again. This worked and successfully wrote auhd
folder into myE:\Python\Python311\envs\main\Lib\site-packages\uhd-4.5.0-py3.11.egg
folder.I suspect the outermost
INSTALL.vcxproj
is not correctly stepping down into the subfolder before running the command. However, this doesn't fix everything. Attempts toimport uhd
are met withThe fix for this was to manually copy
host\build\python\uhd\libpyuhd.pyd
into myE:\Python\Python311\envs\main\Lib\site-packages\uhd-4.5.0-py3.11.egg
folder. I am not sure what went wrong along the builds for this to not have been copied into thehost\build\python\build\lib\uhd
folder like the rest of the.py
files.Then the consequent error from
import uhd
becamewhich is solved on Windows by doing the standard
where my
uhd.dll
file is.1) Need a fix to properly move the .pyd file. 2) Need a fix to properly run the setup.py file in the python subfolder so that it actually installs to site-packages. I suggest also reworking the build to no longer use
setup.py install
as it is already deprecated.