rehmatworks / gplaydl

Command Line Google Play APK downloader. Download APK files to your PC directly from Google Play Store.
MIT License
350 stars 55 forks source link

`configure` does not work when installed by root #11

Closed notsocafe closed 3 years ago

notsocafe commented 3 years ago
Traceback (most recent call last):
  File "/usr/local/bin/gplaydl", line 11, in <module>
    load_entry_point('gplaydl==1.3.5', 'console_scripts', 'gplaydl')()
  File "/usr/local/lib/python3.7/dist-packages/gplaydl/gplaydl.py", line 224, in main
    configureauth()
  File "/usr/local/lib/python3.7/dist-packages/gplaydl/gplaydl.py", line 74, in configureauth
    os.makedirs(CONFIGDIR, exist_ok=True)
  File "/usr/lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/dist-packages/gplaydl/.gplaydl'

Nothing more was done outside of sudo pip3 install gplaydl. Currently running Debian Buster.

sdushantha commented 3 years ago

@notsocafe I think the reason why you are getting Permission denied is because you installed gplaydl using sudo, which tends to be a bad practice. Run the commands below to fix the issue:

# Uninstall gplaydl installed by the root user
$ sudo pip3 uninstall gplaydl

# Install gplaydl, but this time by your user
$ python3 -m pip install gplaydl

If you now run gplaydl configure, the configuration file should be able to be created as there won't be any permission errors.

When you attempt to download an APK, you might encounter some errors. I'm not sure what the issue is but it I'm sure its an issue with the gpapidl module.

rehmatworks commented 3 years ago

Hi @notsocafe I hope the solution proposed by @sdushantha fixed the issue for you. If not, feel free to reopen this issue.