NSLS-II-CHX / CHX_BugReport

Unified issue-tracker for bugs in the data analysis JupyterHub at CHX
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Permissions problem #16

Open auroranr opened 7 years ago

auroranr commented 7 years ago

I am running in my file: data_dir = os.path.join('/XF11ID/analysis/', CYCLE, username, 'Results/2016September/PSPMMA2/T200H/' )

Or define data_dir here, e.g.,#data_dir = '/XF11ID/analysis/2016_2/rheadric/test/'

os.makedirs(data_dir, exist_ok=True) print('Results from this analysis will be stashed in the directory %s' % data_dir)

And I get the following, it looks as if I have a permissions error:

PermissionError Traceback (most recent call last)

in () 14 15 ---> 16 os.makedirs(data_dir, exist_ok=True) 17 print('Results from this analysis will be stashed in the directory %s' % data_dir) /opt/conda_envs/analysis/lib/python3.5/os.py in makedirs(name, mode, exist_ok) 229 if head and tail and not path.exists(head): 230 try: --> 231 makedirs(head, mode, exist_ok) 232 except FileExistsError: 233 # Defeats race condition when another thread created the path /opt/conda_envs/analysis/lib/python3.5/os.py in makedirs(name, mode, exist_ok) 229 if head and tail and not path.exists(head): 230 try: --> 231 makedirs(head, mode, exist_ok) 232 except FileExistsError: 233 # Defeats race condition when another thread created the path /opt/conda_envs/analysis/lib/python3.5/os.py in makedirs(name, mode, exist_ok) 239 return 240 try: --> 241 mkdir(name, mode) 242 except OSError: 243 # Cannot rely on checking for EEXIST, since the operating system PermissionError: [Errno 13] Permission denied: '/XF11ID/analysis/2016_2/Nogales/Results/2016September'
yugangzhang commented 7 years ago

what's your NSLS-II control network account? Nogales or anogales ?

auroranr commented 7 years ago

It is anogales

yugangzhang commented 7 years ago

Ok. Please comment out (put # befor the line) the line in your notebook username = "Nogales" namely, make like:

username = "Nogales"

Then, all the results will be save in /XF11ID/analysis/2016_2/anogales/Results insteady of /XF11ID/analysis/2016_2/Nogales/Results

auroranr commented 7 years ago

Thanks, that worked. Now another path problem. See figure attached. imagen

yugangzhang commented 7 years ago

Please place the setup_pargs cells with

setup_pargs=dict(uid=uid, dpix= dpix, Ldet=Ldet, lambda_= lambda_, 
        timeperframe=timeperframe, center=center, path= data_dir)

Basically, add path = data_dir (where you want to save your data) in the dict.