CADET Introduction - PermissionError: [WinError 5] Access is denied

Hi everyone,

I am following the tutorial script and am getting the following error on the ‘data=model.run()’ command:

PermissionError: [WinError 5] Access is denied

Full error is below:

PermissionError                           Traceback (most recent call last)
Cell In[6], line 6
      3 model.filename = 'model.h5'
      4 model.save()
----> 6 data = model.run()
      8 if data.returncode == 0:
      9     print("Simulation completed successfully")

File ~\AppData\Local\anaconda3\Lib\site-packages\cadet\cadet.py:213, in Cadet.run(self, timeout, check)
    212 def run(self, timeout = None, check=None):
--> 213     data = self.cadet_runner.run(simulation=self.root.input, filename=self.filename, timeout=timeout, check=check)
    214     #self.return_information = data
    215     return data

File ~\AppData\Local\anaconda3\Lib\site-packages\cadet\cadet.py:237, in CadetFile.run(self, filename, simulation, timeout, check)
    235 def run(self, filename = None, simulation=None, timeout = None, check=None):
    236     if filename is not None:
--> 237         data = subprocess.run([self.cadet_path, filename], timeout = timeout, check=check, capture_output=True)
    238         return data
    239     else:

File ~\AppData\Local\anaconda3\Lib\subprocess.py:548, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    545     kwargs['stdout'] = PIPE
    546     kwargs['stderr'] = PIPE
--> 548 with Popen(*popenargs, **kwargs) as process:
    549     try:
    550         stdout, stderr = process.communicate(input, timeout=timeout)

File ~\AppData\Local\anaconda3\Lib\subprocess.py:1026, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
   1022         if self.text_mode:
   1023             self.stderr = io.TextIOWrapper(self.stderr,
   1024                     encoding=encoding, errors=errors)
-> 1026     self._execute_child(args, executable, preexec_fn, close_fds,
   1027                         pass_fds, cwd, env,
   1028                         startupinfo, creationflags, shell,
   1029                         p2cread, p2cwrite,
   1030                         c2pread, c2pwrite,
   1031                         errread, errwrite,
   1032                         restore_signals,
   1033                         gid, gids, uid, umask,
   1034                         start_new_session, process_group)
   1035 except:
   1036     # Cleanup if the child failed starting.
   1037     for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File ~\AppData\Local\anaconda3\Lib\subprocess.py:1538, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)
   1536 # Start the process
   1537 try:
-> 1538     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
   1539                              # no special security
   1540                              None, None,
   1541                              int(not close_fds),
   1542                              creationflags,
   1543                              env,
   1544                              cwd,
   1545                              startupinfo)
   1546 finally:
   1547     # Child is launched. Close the parent's copy of those pipe
   1548     # handles that only the child should have open.  You need
   (...)
   1551     # pipe will not close when the child process exits and the
   1552     # ReadFile will hang.
   1553     self._close_pipe_fds(p2cread, p2cwrite,
   1554                          c2pread, c2pwrite,
   1555                          errread, errwrite)

PermissionError: [WinError 5] Access is denied

First thing I did was look this up on stack overflow - they said to update folder permissions.
I have updated security permissions in the AppData folder and am running this in Jupyter notebook with administrator rights.
Not sure what’s going wrong and would greatly appreciate any input :slight_smile:

Hello Shubhra and welcome to the Forum,

which tutorial are you following? The CADET Python Tutorial or the CADET-Process Tutorial? Because we highly recommend using CADET-Process.

If you are using CADET-Process, could you please share the code that raised the error and a copy of the output of

conda list

and

pip list

please? Thank you.