Closed VolkerH closed 2 years ago
This is tricky. For the wheel on pypi, cibuildwheel takes care of all the relocatability issues for us... but that doesn't happen when building locally. It's "enough" for tests on CI but not super robust. Will look into it
As a workaround, I .resolve()
d the relative paths in setup.py
and install with pip -e
.
That is not working with just pip
so is not the correct way, but it lets me install local changes into my python environment.
@shenker was able to build locally on a linux using the following:
mamba env create -n nd2test
mamba activate nd2test
# installing deps from conda... not sure if this part is critical
mamba install -c conda-forge cython black flake8 flake8-docstrings \
imagecodecs aicsimageio ipython isort mypy pre-commit psutil \
pydocstyle pytest pytest-cov wurlitzer xarray resource_backed_dask_array \
python=3.10.4 requests
git clone git@github.com:tlambert03/nd2.git
cd nd2
python scripts/download_samples.py
make
pip install --no-deps -e .
# i bet this part is critical ... since the wheel isn't relocatable unless you build with cibuildwheel
LD_LIBRARY_PATH=$CONDA_PREFIX/lib pytest
Since this is ultimately doesn't affect the way the package gets built and distributed on linux for either pypi or conda forge, I'm going to close this as difficult to fix. If you try again, let me know if setting the LD_LIBRARY_PATH solves it in your local dev environment
Facing Same issue as @VolkerH , ubuntu 20.04
sorry about that @uthapa82. Are you trying to install for local development? Did you try @shenker's approach in https://github.com/tlambert03/nd2/issues/24#issuecomment-1147923768?
@tlambert03 No worries, it happens. I am just trying to use it to convert nd2 to jpeg file, but can't seem to use the module. I tried adding LD_LIBRARY_PATH no luck there, I tried @shenker's approach that also didn't worked form me, for now I used the windows VM and seems to work perfectly there but not on Ubuntu 20.04
If you're trying to just use the library, how did you install? Installation from conda is your best bet
Sound good, I am just trying to use to it. So probably will try with conda and see if that solves. Appreciate your information
Description
When pulling the latest main and doing a local install with
pip install .
orpip install -e .
from thend2
folder the shared library doesn't get installed correctly. When executing code from the location of where I installed the repo, everything works fine. When executing the code from a different working directory I get import errors.What I Did
running my tests from the
nd2
directory works without ImportError (note that the Python Kernel dies when reading nd2, I am investigating and will open a separate issue).running my tests from some other directory fails with
ImportError
:I suspect that the issue is somewhere here:
https://github.com/tlambert03/nd2/blob/main/setup.py#L10-L13
But haven't been able to figure out exactly what goes wrong.