Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Os.statvfs issue on Python2.7

Tags:

python-2.7

I have installed python 2.7 and trying to run below code which always gives error:

# !/usr/bin/python

import os, sys

stinfo = os.statvfs("C:\Tools")

And error comes as :

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'statvfs'

Any clue to make it work?

like image 996
user2033758 Avatar asked Mar 29 '26 17:03

user2033758


1 Answers

I'm assuming from your example file path that you're using Windows.

The os.statvfs() call is not supported in Windows. An attempt to add support was made, but was rejected.

You might find this answer helpful for possible solutions.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!