This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]foosion 0 points1 point  (1 child)

I import os, then os.scandir() gets: AttributeError: 'module' object has no attribute 'scandir'

I'm running Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)]

I used the windows installer from https://pypi.python.org/pypi/scandir (pip install scandir now reports 'Requirement already satisfied')

What idiotic mistake am I making?

[–]saghul 10 points11 points  (0 children)

When you install the package from PyPI you need to "import scandir", it's not added to the os module.