ERPNext Errors (Internal Server Error)

I’m getting Internal Server Errors and when I run some commands, I get the following:

Exception:
Traceback (most recent call last):
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/req/req_set.py”, line 784, in install
**kwargs
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/req/req_install.py”, line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/req/req_install.py”, line 1064, in move_wheel_files
isolated=self.isolated,
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/wheel.py”, line 345, in move_wheel_files
clobber(source, lib_dir, True)
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/wheel.py”, line 316, in clobber
ensure_dir(destdir)
File “/opt/bitnami/python/lib/python3.7/site-packages/pip-9.0.1-py3.7.egg/pip/utils/init.py”, line 83, in ensure_dir
os.makedirs(path)
File “/opt/bitnami/python/lib/python3.7/os.py”, line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: ‘/opt/bitnami/python/lib/python3.7/site-packages/Jinja2-2.10.3.dist-info’

Any assistance would be appreciated

It may help if you can say the operating environment, version of ERPNext, the command that produced the error and whether the command had been run successfully in the past or if this is a new installation .

I’m running Version 12, hosted on Azure (Bitnami Stack).

I’d run this command: pip install --upgrade pip

I suppose you could try prepending sudo to the command as the error suggests that writing to the folders requires permissions that the user invoking the command may not have.

I sorted this issues using sudo.

Now I get this after running bench mariadb

Traceback (most recent call last):
File “/opt/bitnami/python/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/opt/bitnami/python/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 375, in mariadb
“-A”])
OSError: [Errno 8] Exec format error

Is there a way of "re-building"ERPNext if there is some a thing to get rid of all these errors?