l3uddz / plex_autoscan

Script to assist sonarr/radarr with plex imports. Will only scan the folder that has been imported, instead of the whole library section.
GNU General Public License v3.0
396 stars 70 forks source link

ImportError: cannot import name GoogleDrive with Python2 #94

Closed desimaniac closed 5 years ago

desimaniac commented 5 years ago

@sabrsorensen @l3uddz @daghaian

   File "/opt/plex_autoscan/scan.py", line 73, in <module>
     from google import GoogleDrive, GoogleDriveManager
 ImportError: cannot import name GoogleDrive

Any reason why this would be occurring randomly with python2 but resolves when you change the shebang to #!/usr/bin/env python3? If need be, we can switch them all to have that shebang.

sabrsorensen commented 5 years ago

I don't know why this would be cleared up by switching to Python 3, cursory googling shows this as a possible circular dependency but I couldn't see where that was the case. Would changing to import google possibly address the issue? I think google/__init__.py is already configured to import GoogleDrive and GoogleDriveManager into the same namespace as from google import GoogleDrive, GoogleDriveManager.

desimaniac commented 5 years ago

The user eventually uninstalled all pip packages and reinstalled python again and that seemed to have fixed it. Not sure how another package could have been an issue. I guess we can close this for now.

n0rbertg commented 5 years ago

Just a FYI, I've ran into this as well, and import google fixed it. Not sure which package caused it, I've upgraded Cloudbox and the OS as well (Ubuntu 18.04) and after Cloudbox upgrade plex_autoscan didn't start.