trakBan / spongebob-cli

Watch classic spongebob from the terminal! 🎥🧽
GNU General Public License v3.0
570 stars 23 forks source link

Error: Permission denied: '/usr/local/lib/python3.8' #31

Closed indicozy closed 2 years ago

indicozy commented 2 years ago

Hi there! Love your work, man, but I cannot install it properly. Your code asks to install packages to the root files and I don't want to mess up my system. Should I create venv or maybe you should consider using another solution for automatic installation of packages?

Code

➜  spongebob-cli git:(main) chmod +x spongebob-cli
python3 setup.py install
running install
/usr/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python3.8'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python3.8/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
trakBan commented 2 years ago

You have to give root to python3 setup.py install. The reason for this is because it is moving the file into /usr/bin/ which requries root. You can simply fix this by typing sudo python3 setup.py install.

The python packages get installed in the default directory /usr/lib/python3.10/site-packages/ so it won't mess up your system. If you want to install this without giving root access you can also do:

pip install -r requirements.txt
python3 spongebob-cli

Keep in mind you have to be in the directory of spongebob-cli in order for this to work. The only reason why you need root is so you can run it anywhere in the terminal by just typing spongebob-cli