FileNotFoundError: [WinError 2] The system cannot find the file specified

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FileNotFoundError: [WinError 2] The system cannot find the file specified

gf23
Hi, I am getting the following error when syncing the reasoner where I previously did not. I did not change anything in the code or in the computer that I am running it from since it last worked. Also, the program is able to successfully sync the reasoner using the same code when run from another laptop. I have tried to reinstall everything and even reset the computer in case any files were accidently deleted but the error remains. I've also tried to search google for solutions but the few solutions were not applicable to me. I don't have a lot of knowledge on how things like this work in the background of programs, does anyone know what could be going wrong? Thanks in advance!

  File "C:\Users\z5238223\OneDrive - UNSW\07_MyPrograms\Python\Owlready2\MainProgram_20201108_v3.5_GF.py", line 47, in syncreasoner
    sync_reasoner_pellet(infer_property_values = True, infer_data_property_values = True)

  File "C:\Users\z5238223\anaconda3\lib\site-packages\owlready2\reasoning.py", line 245, in sync_reasoner_pellet
    output = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, check = True).stdout

  File "C:\Users\z5238223\anaconda3\lib\subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Users\z5238223\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 105, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Users\z5238223\anaconda3\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

  File "C:\Users\z5238223\anaconda3\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified
Reply | Threaded
Open this post in threaded view
|

Re: FileNotFoundError: [WinError 2] The system cannot find the file specified

Jiba
Administrator
Hi,

This seems to be an installation problem.

I think you should try to run the reasoner manually (Owlready prints the command line on the output; use the keep_tmp_file = 1 option when calling the reasoner to keep temporary files so as you can run it later). The output may be interesting to identify the problem.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: FileNotFoundError: [WinError 2] The system cannot find the file specified

gf23
After much digging, I finally found that it was simply just the link to the java application that was incorrect (it must have changed when I updated java). If I get stuck again I'll try your suggestion. Thanks very much Jiba! :)