How to stop the binary being downloaded?
mpickering opened this issue · comments
Any use of the python library attempts to download a tarball into a read only directly on my system. I already have whitebox_tools on my path, so I do not want to download it again.
- The file should be downloaded into one of the XDG_* directories rather than into this read-only directory.
- The file wouldn't work even if it was downloaded on my OS so I would prefer to have the option to skip this step.
[nix-shell:~/whitebox-python]$ ./lidar.py
Downloading WhiteboxTools pre-compiled binary for first time use ...
Unexpected error: <class 'OSError'>
Traceback (most recent call last):
File "./lidar.py", line 5, in <module>
from whitebox.whitebox_tools import WhiteboxTools
File "/nix/store/cnzdmpl269k27j4j28l0xmi39yr278qw-python3-3.7.7-env/lib/python3.7/site-packages/whitebox/__init__.py", line 10, in <module>
from .wb_runner import Runner
File "/nix/store/cnzdmpl269k27j4j28l0xmi39yr278qw-python3-3.7.7-env/lib/python3.7/site-packages/whitebox/wb_runner.py", line 33, in <module>
wbt = WhiteboxTools()
File "/nix/store/cnzdmpl269k27j4j28l0xmi39yr278qw-python3-3.7.7-env/lib/python3.7/site-packages/whitebox/whitebox_tools.py", line 144, in __init__
download_wbt()
File "/nix/store/cnzdmpl269k27j4j28l0xmi39yr278qw-python3-3.7.7-env/lib/python3.7/site-packages/whitebox/whitebox_tools.py", line 55, in download_wbt
urllib.request.urlretrieve(url, zip_name) # Download WhiteboxTools
File "/nix/store/syqcp8zb9c0vxj2sx6jbv5f9q7yki4jz-python3-3.7.7/lib/python3.7/urllib/request.py", line 257, in urlretrieve
tfp = open(filename, 'wb')
OSError: [Errno 30] Read-only file system: '/nix/store/cnzdmpl269k27j4j28l0xmi39yr278qw-python3-3.7.7-env/lib/python3.7/site-packages/whitebox/WhiteboxTools_linux_amd64.tar.xz'
Workaround:
- Clone the source of the latest release - https://github.com/jblindsay/whitebox-tools/releases/tag/v1.2.0
- Create a symlink
ln -s $(which whitebox_tools) whitebox_tools
in the root folder