Transformer icon indicating copy to clipboard operation
Transformer copied to clipboard

error: file not found

Open Scum1254 opened this issue 5 years ago • 5 comments

how do i run this on my local pc? it always shows me that error: file not found. even the files are in that folder. i tried all slash versions [/, \, //, \, ]nothing worked to find that folder or .txt file

Scum1254 avatar Jul 21 '19 18:07 Scum1254

Use pwd in linux or cd in windows to get current working directory and then try ls in Linux or dir in Windows to get the files and folders in that current working directory. (Upload the snap of the terminal so I can get more info about the same.)

srajan-jha avatar Jul 30 '19 06:07 srajan-jha

Screenshot (26)

its-Anshul avatar Aug 08 '19 08:08 its-Anshul

@its-Anshul what you've mentioned above seems to work just fine in my case. terminal

Do this! (trying ls)

terminal

PS you do't need to mention the whole path of the english.txt file, writing -src_data data/english.text would be enough if there exists the english.txt file.

srajan-jha avatar Aug 08 '19 09:08 srajan-jha

@srajan-jha Actually issue was with the data. While reading the file it encountered the error and as written in code in Process.py : try: opt.src_data = open(opt.src_data).read().strip().split('\n') except: print("error: '" + opt.src_data + "' file not found") quit()

it is printing file not found.

So fixed it by changing except as follows :

except Exception as e: print("error: '" + str(e)) quit()

And hence found the real error.

Thanks for helping

its-Anshul avatar Aug 08 '19 10:08 its-Anshul

@its-Anshul Right. In my case, the real mistake is UnicodeDecodeError. I fixed it by adding encoding='utf-8': opt.src_data = open(opt.src_data,encoding='utf-8').read().strip().split('\n')

SCNUJackyChen avatar Sep 05 '19 08:09 SCNUJackyChen