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
PermissionError when creating data_dir when user doesn't have permissions #4664
Comments
Can you tell me if you start multiple processes before or after you import sxikit image? |
@hmaarrfk it seems that skimage is trying to create the data dir at import time in https://github.com/scikit-image/scikit-image/blob/master/skimage/data/__init__.py#L90 Is that necessary? Could it be delayed to the On the Pooch side, if we don't raise an exception with a permission error (only issue a warning as seen above). So it wouldn't cause any problems unless the user wants to load sample data. |
Should we open an issue in appdirs regarding using Opened one ActiveState/appdirs#146 |
In a more generic way, tempfile.gettempdir() |
This is definitely an issue we should workaround today. I'm just waiting until we merge in an other pull request relating to this new feature of ours. |
@hmaarrfk Thanks for looking into it! I think multiple processes are started after skimage is imported. Although the problem occurs at import time. Yeah I'm not sure if this should be an issue in appdirs, pooch or scikit-image. Although from my point of view as a user of scikit-image, I feel the library might be trying to do much for me without asking. The error states:
, but I don't even want to use this functionality. In my use case, I don't need it. |
What about simply wrap the directory creation in a |
@leducvin you have been heard loud and clear, and we are working toward a solution that will work well with python 3.6 (though that isn't clear how we would do it). Unfortunately, for now, this isn't an issue that we can solve right way. We have a few contradictory requirements:
For now, I would suggest you skip
You may you use Rest assured that we are working to resolve this breaking change for your application. |
No worries. I already started using As mentioned in ActiveState/appdirs#146, setting a |
I agree that this should not cause failure. 0.17.2 doesn't have the pooch requirement, but pooch may be installed by an other of your dependencies by accident. We just need to balance a few other things to get it right. In my mind, you shouldn't have to use any configuration to get going in your usecase. The only time you should set that environment variable is if you want to have a shared store of our future GB large datasets. |
When using a AWS Lambda, still is also a problem. |
I was using this in my docker container. Setting up the environment variable solved my problem! Thanks! |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/why-does-init-py-attempt-to-download-sample-data/79665/4 |
Reproducable with
|
I'll look into fixing this. |
Description
Version 0.16.2 worked, but 0.17.1 tries to create a directory in whatever
appdirs
thinks is an appropriate cache directory.For my flask app's service, the user is a no-login user, and somehow this resolves to
/var/www/
.The user doesn't have permissions to create a directory there, so the flask app crashes with a PermissionError raised from skimage.
I specified
SKIMAGE_DATADIR=/tmp/.skimage_cache
, and ended up seeing #4660, as my flask app starts multiple processes.Way to reproduce
Version information
The text was updated successfully, but these errors were encountered: