python - 在 Python Ubuntu 上更改目录时出错

标签 python python-2.7 ubuntu directory

这里对 python 非常陌生,我已经引用了其他几个关于堆栈溢出的问题,但我看不出我在这里做错了什么。我尝试了以下方法:

os.chdir('/home/documents/Netflix Project/Cleaned Data')

os.chdir("/home/luke/documents/Netflix Project/Cleaned Data")

每次我得到同样的错误:
OSError: [Errno 2] No such file or directory: '/Home/luke/Documents/Netflix Project/Cleaned Data'

我是否使用不正确的语法来调用目录?我一直基于以下几点:
>>> os.getcwd()
'/home'

最佳答案

路径区分大小写。你确定你没有使用Home而不是 home ?回溯看起来像你。

关于python - 在 Python Ubuntu 上更改目录时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51427785/

相关文章:

python - 如何在 jupyter 笔记本中运行 Spark-Submit?

python - 使用 xlwt 格式字符串设置单元格格式

ubuntu - 是否可以建立一个纯内部NTP系统?

ubuntu - Ubuntu 中的 Dartium

python - 溢出错误: Unsupported value

linux - 在 .zshrc : No such file or directory 中使用 grep 命令

python - 在Python中显示所有父文件夹

Python 数据帧复制

python - 多个相关的 Python 项目是否需要自己的虚拟环境?

python - Windows 7 上的 numpy 安装