Since the target did exist, the answer above didn't help me, but the question prompted me to try a regular python open instead of through pandas: )įileNotFoundError: No such file or directory: 'codes-no-agg-children.xlsx' In : codes = pd.read_excel('codes-no-agg-children.xlsx'. Trying to open a file across a symlink in pandas gave an unhelpful not-found message: ⇒ ipython.exe # this is a clue to the answer below. I'm logging an answer because I came to this question with the same problem, but the target of my symlink did exist. ( b is a link file, 3 bytes long, contents './a'.)īut ls -lL attempts to resolve the link, fails, and displays the failure information. Since ls -l never attempts the resolve the link, its output is unchanged from the previous test. Now b is a link that resolves to a file that no longer exists. Ls: cannot access b: No such file or directory With -L, ls now claims that b is also a six-byte text file. Now ls has resolved the link in b, and displays information about the linked-to file. ls is able to describe the properties of the link without dereferencing the link itself. b is a link file containing the three bytes to its target path: './a'. aĪ is a text file containing the six bytes 'hello\n'. Absent the -L option, ls never attempts to resolve the symbolic link.Ĭonsider a directory with these two files: $ ls -l The ls command by default operates on the link itself, not on the target of the link. I don't understand why I was able to resolve it in the ls statement in my question. The target of the symbolic link doesn't exist. IOError: No such file or directory: '/Users/therold/Programming/ML/deeptank/dataset/inc/training/tanks/matilda-iv_689.png'Īny ideas what I am doing wrong? Help is much appreciated. > open("/Users/therold/Programming/ML/deeptank/dataset/inc/training/tanks/matilda-iv_689.png") However the Python open() method fails me: (master)$ python OSX is clearly able resolve the symlinked image file. training_data/matilda-iv/matilda-iv_689.png (master)$ ls -lisa /Users/therold/Programming/ML/deeptank/dataset/inc/training/tanks/matilda-iv_689.pngħ870541 8 lrwxr-xr-x 1 therold staff 46 13 Mai 16:44 /Users/therold/Programming/ML/deeptank/dataset/inc/training/tanks/matilda-iv_689.png ->. I was under the impression that symlinks are resolved on the OS level so Python would never know about it. I made sure the file exists and I can access it. Python is unable to open my simlinked file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |