Postgres error at "python -m remo_app init", tried to install manually says it's already installed

Hi, I been trying to install remo on Windows 10 and I had this issue, I already checked this forum but didn’t found a solution, please help me out. Thanks in advance. This is the issue:

[-] Installing postgres
Traceback (most recent call last):
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app_main
.py", line 3, in
app()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\typer\main.py”, line 211, in call
return get_command(self)()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\typer\main.py”, line 494, in wrapper
return callback(**use_params) # type: ignore
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\cmd.py”, line 82, in init
db_config = installer.install(postgres=db)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\installer.py”, line 212, in install
db_params, ok = postgres.install()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\installer.py”, line 59, in install
if not self.is_running():
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\postgres.py”, line 25, in is_running
return Shell.ok(“psql -U postgres -l”)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\shell.py”, line 35, in ok
result = Shell.run(cmd, show_command=show_command, show_output=show_output, exit_on_error=exit_on_error)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\shell.py”, line 62, in run
result.stderr = stderr.read().decode(‘utf-8’).strip()
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xbf in position 123: invalid start byte

Hi @tako!

EDIT - Have you tried to to uninstall PostgreSQL and re-install it manually?

We will be also looking at what the issue with utf-8 codec might be, we haven’t seen that one before.

Andrea

I tried to uninstall it, but I don’t know how if there is not an option to do that through the control panel.

When you say “Control Panel”, you mean you don’t have it in “Add/Remove program”?

Some other things you can try to uninstall it:

uninstall-postgresql.exe --mode unattended

Hello @tako ,

We recently released remo 0.5.5 with fix for your issue,
could you try it

Let us know if you still experience this or other issues

Hello @vmanilo ,

I could put the password and everything for postgres, but there’s another error:

\Python38\site-packages\django\db\utils.py", line 121, in load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: ‘django.db.backends.postgresql’ isn’t an available database backend.
Try using ‘django.db.backends.XXX’, where XXX is one of:
‘mysql’, ‘oracle’, ‘sqlite3’

Full error:

[-] Installing postgres
Contraseña para usuario postgres:
$ psql -U postgres -c “create user remo with encrypted password ‘remo’;”
Contraseña para usuario postgres:
$ psql -U postgres -c “create database remo;”
Contraseña para usuario postgres:
$ psql -U postgres -c “grant all privileges on database remo to remo;”
Contraseña para usuario postgres:

Postgres database connection parameters:
{
“engine”: “postgres”,
“host”: “localhost”,
“name”: “remo”,
“password”: “remo”,
“port”: “5432”,
“user”: “remo”
}

Completed - requirements already satisfied

  • Prepare database
    Traceback (most recent call last):
    File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\utils.py”, line 110, in load_backend
    return import_module(’%s.base’ % backend_name)
    File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\importlib_init_.py”, line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 961, in _find_and_load_unlocked
    File “”, line 219, in _call_with_frames_removed
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 973, in _find_and_load_unlocked
    ModuleNotFoundError: No module named ‘django.db.backends.postgresql’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 194, in run_module_as_main
return run_code(code, main_globals, None,
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app_main
.py", line 3, in
app()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\typer\main.py”, line 211, in call
return get_command(self)()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 1259, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\typer\main.py”, line 494, in wrapper
return callback(**use_params) # type: ignore
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\cmd.py”, line 87, in init
migrate()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\db.py”, line 16, in migrate
manage(‘migrate’)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\remo_app\cmd\db.py”, line 11, in manage
execute_from_command_line(argv)
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\core\management_init
.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\core\management_init
.py", line 357, in execute
django.setup()
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django_init
.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\apps\registry.py”, line 114, in populate
app_config.import_models()
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\apps\config.py”, line 211, in import_models
self.models_module = import_module(models_module_name)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\contrib\auth\models.py”, line 2, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\contrib\auth\base_user.py”, line 47, in
class AbstractBaseUser(models.Model):
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\models\base.py”, line 117, in new
new_class.add_to_class('meta’, Options(meta, app_label))
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\models\base.py”, line 321, in add_to_class
value.contribute_to_class(cls, name)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\models\options.py”, line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db_init
.py", line 28, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\utils.py”, line 201, in getitem
backend = load_backend(db[‘ENGINE’])
File “C:\Users\tako\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\db\utils.py”, line 121, in load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: ‘django.db.backends.postgresql’ isn’t an available database backend.
Try using ‘django.db.backends.XXX’, where XXX is one of:
‘mysql’, ‘oracle’, ‘sqlite3’

@tako

thank you for sharing the error log,

could you confirm are you installing remo in python virtual env or system wide? (recommended to use python or conda env)

could you list your installed package and their versions with pip freeze

UPD:
you can also check this comment from stackoverflow https://stackoverflow.com/a/61967345
looks like similar issue