python - AttributeError: 模块 'os' 没有属性 'chroot'

标签 python python-3.x attributeerror chroot

下面是我在 spyder 和 python 中运行的非常基本的代码令人窒息,我做错了什么?

import csv,os,sys
path = os.getcwd()
print (path)
os.chroot(path)

我收到以下错误消息:

  os.chroot(path)

AttributeError: module 'os' has no attribute 'chroot'

最佳答案

一种可能是您的操作系统是 Microsoft Windows,os.chroot() is not available .

关于python - AttributeError: 模块 'os' 没有属性 'chroot',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40051790/

相关文章:

python - Flask URL 中的日期

python - 如何从python导入路径中删除当前目录

python - AttributeError: 'MyGrid' 对象没有我的函数的属性

python - 导入 pandas 模块给出属性错误

python - tensorflow::Tensor 到 python Tensor 或 numpy.nd_array

python - 将 C 应用程序与 Python GUI 结合使用

python - 属性错误: 'AnonymousUserMixin' object has no attribute 'can'

python - 如果返回值不是 bool 值则退出 If 语句

python - AttributeError: 'WSGIRequest' 对象没有属性 'user'

Python 与 MATLAB 在算法上的性能