找不到 Jupyter 笔记本路径

时间:2021-02-09 15:04:43

标签: python compiler-errors jupyter-notebook coding-style filepath

  1. 我试图找到该文件。向前和向后使用我也使用了 1 和 2 个撇号 - 没有任何改变
  2. 这是我遇到的错误 Error I'm Getting

2 个答案:

答案 0 :(得分:0)

Windows 有点棘手。这只是一种预感,但也许可以尝试:

path = "C:\\Users\\BarbieA\\.... " 

Windows 路径由 \ 分隔,但由于它用于转义特殊字符,因此您也需要对其进行转义,因此它变为 \\

答案 1 :(得分:0)

是的。我建议使用 pathlib 使您的生活更轻松,因为有时手写时空格和特殊符号可能会令人困惑。

from pathlib import PureWindowsPath
file = PureWindowsPath(r"C:\Users\Barbie..")
open(file)