Python: import symbolic link of a folder

后端 未结 2 1079
夕颜
夕颜 2020-12-29 07:58

I have a folder A which contains some Python files and __init__.py.

If I copy the whole folder A into some other folder B and create there a file with \"import A\",

2条回答
  •  梦毁少年i
    2020-12-29 08:59

    This kind of behavior can happen if your symbolic links are not set up right. For example, if you created them using relative file paths. In this case the symlinks would be created without error but would not point anywhere meaningful.

    If this could be the cause of the error, use the full path to create the links and check that they are correct by lsing the link and observing the expected directory contents.

提交回复
热议问题