Error while using an site

Hi All,
I was just finished ERPNext Installation with the latest version.
Now, when I was installing the using the site it is giving me an error and same is not working with the sudo as well.

However, I can clearly see that there is a permission error but how to overcome this.
Apart from that, I am facing the same issue (permission denied) with all the bench commands however as a solution of those commands, I did run with sudo whereas in this case it is not working.

Edit: Error Message is:

vishnu@vishnu-VirtualBox:/home/frappe/frappe-bench$ bench use library
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 245, in _use
    use(site, sites_path=sites_path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 248, in use
    with open(os.path.join(sites_path,  "currentsite.txt"), "w") as sitefile:
IOError: [Errno 13] Permission denied: u'./currentsite.txt'

Any idea about this?

Regards
Ruchin Sharma

i try Option 1 or Option 2, its work…

Option 1:
home/frappe/frappe-bench$ bench use library
home/frappe/frappe-bench$ sudo bench use library

Option 2:
frappe/frappe-bench$ su frappe
Password:
~/frappe-bench$ bench use library

lemme try

@komsel2228
I tried both the ways but both are not working for me.ab
Even, I have no idea about frappe password.

Also, when I tried to see frappe and its sub-folders in the File Explorer, I didn’t see any possibly this is the issue with use rights.

I appreciate if you or anyone can help me in this context.

Regards
Ruchin Sharma

have created sites “library” ?
if not. you must create that site first.
frappe-bench$ bench new-site library

after that,
frappe-bench$ bench use library

@komsel2228
I did create the site library and the above command is working for me now.
But earlier it was not working don’t know why whereas I was already having site library.

Apart from that my worry is I am not able to see any of the frappe folder in file manager, do you have any idea about this?

Regards
Ruchin Sharma

Did you do completely new installation or updated you previous version? If it is new installation you will have to follow all the steps again of getting apps and creating a site.
https://frappe.github.io/erpnext/install.html

@KanchanChauhan
Yes, it is a new installation and I am able to do everything login to the ERP, Installed library App but the issue is, I am not able to see the frappe and other sub-folder in Ubuntu File Manager.

Regards
Ruchin Sharma

@KanchanChauhan
@komsel2228

I found it thanks to all of you for your help.

Regards
Ruchin Sharma