AttributeError: 'module' object has no attribute 'scandir'

Aido

I have no idea why this is happening. Here's the function:

def scanWallDir(basedir, scansubdirs=True):
    wallsOut = []
    for entry in os.scandir(basedir):
        if entry.is_file():
            print(("file " + entry.name))
        elif entry.is_dir():
            print(("dir  " + entry.name))

And the error:

/usr/bin/python2.7 /home/aidan/Code/ulwscs/ulwscs.py
Traceback (most recent call last):
  File "/home/aidan/Code/ulwscs/ulwscs.py", line 38, in <module>
    scanWallDir("/media/Crossover/Wallpapers")
  File "/home/aidan/Code/ulwscs/ulwscs.py", line 11, in scanWallDir
    for entry in os.scandir(basedir):
AttributeError: 'module' object has no attribute 'scandir'

Process finished with exit code 1

Does anyone know what could be heppening?

Aido

Pycharm reset which version of Python I was using. I'm an idiot.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

AttributeError: 'module' object has no attribute

From Dev

AttributeError: 'module' object has no attribute

From Dev

AttributeError: 'module' object has no attribute

From Dev

AttributeError:'module' object has no attribute 'call' :Python

From Dev

AttributeError: 'module' object has no attribute 'tk'

From Dev

AttributeError: 'module' object has no attribute 'cache'

From Java

AttributeError: 'module' object has no attribute 'tests'

From Dev

AttributeError: 'module' object has no attribute 'TestCase'

From Dev

AttributeError: 'module' object has no attribute 'version'

From Dev

Mtaplotlib AttributeError: 'module' object has no attribute 'pyplot'

From Dev

AttributeError: 'module' object has no attribute 'plotting'

From Java

AttributeError: 'module' object has no attribute 'request'

From Java

tensorflow:AttributeError: 'module' object has no attribute 'mul'

From Java

AttributeError: 'module' object has no attribute 'urlretrieve'

From Dev

AttributeError: 'module' object has no attribute 'grd'

From Dev

AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'

From Dev

AttributeError: 'module' object has no attribute 'SFrame'

From Dev

Pylint AttributeError: 'module' object has no attribute 'append'

From Dev

Inheritance AttributeError: 'module' object has no attribute

From Dev

AttributeError: 'module' object has no attribute 'ORB'

From Dev

AttributeError: 'module' object has no attribute 'utcnow'

From Dev

AttributeError: "'module' object has no attribute 'ARRAY'"

From Dev

AttributeError: 'module' object has no attribute 'div'

From Dev

Python AttributeError: 'module' object has no attribute 'atoi'

From Dev

AttributeError: 'module' object has no attribute 'EmailInput'

From Dev

python - AttributeError: 'module' object has no attribute 'lock'

From Dev

AttributeError: 'module' object has no attribute '[x]'

From Dev

Pygame AttributeError: 'module' object has no attribute 'copy'

From Dev

SQLAlchemy AttributeError: 'module' object has no attribute 'PandasSQLAlchemy'

Related Related

  1. 1

    AttributeError: 'module' object has no attribute

  2. 2

    AttributeError: 'module' object has no attribute

  3. 3

    AttributeError: 'module' object has no attribute

  4. 4

    AttributeError:'module' object has no attribute 'call' :Python

  5. 5

    AttributeError: 'module' object has no attribute 'tk'

  6. 6

    AttributeError: 'module' object has no attribute 'cache'

  7. 7

    AttributeError: 'module' object has no attribute 'tests'

  8. 8

    AttributeError: 'module' object has no attribute 'TestCase'

  9. 9

    AttributeError: 'module' object has no attribute 'version'

  10. 10

    Mtaplotlib AttributeError: 'module' object has no attribute 'pyplot'

  11. 11

    AttributeError: 'module' object has no attribute 'plotting'

  12. 12

    AttributeError: 'module' object has no attribute 'request'

  13. 13

    tensorflow:AttributeError: 'module' object has no attribute 'mul'

  14. 14

    AttributeError: 'module' object has no attribute 'urlretrieve'

  15. 15

    AttributeError: 'module' object has no attribute 'grd'

  16. 16

    AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'

  17. 17

    AttributeError: 'module' object has no attribute 'SFrame'

  18. 18

    Pylint AttributeError: 'module' object has no attribute 'append'

  19. 19

    Inheritance AttributeError: 'module' object has no attribute

  20. 20

    AttributeError: 'module' object has no attribute 'ORB'

  21. 21

    AttributeError: 'module' object has no attribute 'utcnow'

  22. 22

    AttributeError: "'module' object has no attribute 'ARRAY'"

  23. 23

    AttributeError: 'module' object has no attribute 'div'

  24. 24

    Python AttributeError: 'module' object has no attribute 'atoi'

  25. 25

    AttributeError: 'module' object has no attribute 'EmailInput'

  26. 26

    python - AttributeError: 'module' object has no attribute 'lock'

  27. 27

    AttributeError: 'module' object has no attribute '[x]'

  28. 28

    Pygame AttributeError: 'module' object has no attribute 'copy'

  29. 29

    SQLAlchemy AttributeError: 'module' object has no attribute 'PandasSQLAlchemy'

HotTag

Archive