Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

> How to make PyCharm launch with root privileges?, so I don't have to sudo nano

views
     
TSk town shit
post Mar 22 2020, 02:51 PM, updated 6d ago

Casual
***
Junior Member
474 posts

Joined: Jan 2009
hi everyone, Ayam trying to create a module in the Open Source ERP by following the book, but the book never cover how to properly setup PyCharm CE in Ubuntu.

The screenshot below shows the challenge which I'm facing, I'm unable to edit an addon directly in the PyCharm CE:
user posted image


I been searching through the stackexchange kinf of forum, and tried the following methods but to no avail:
I tried to create a python-sudo.sh (like screenshot below) and let the PyCharm use this as Project Inerpreter, but it ends up with error
user posted image


Anyone can help with this, a video tutorial or remote, please? icon_question.gif
Thanks in advance

This post has been edited by k town shit: Mar 22 2020, 02:53 PM
kmc3388
post Mar 22 2020, 03:00 PM

New Member
*
Newbie
7 posts

Joined: Nov 2014
QUOTE(k town shit @ Mar 22 2020, 02:51 PM)
hi everyone, Ayam trying to create a module in the Open Source ERP by following the book, but the book never cover how to properly setup PyCharm CE in Ubuntu.

The screenshot below shows the challenge which I'm facing, I'm unable to edit an addon directly in the PyCharm CE:
user posted image
I been searching through the stackexchange kinf of forum, and tried the following methods but to no avail:
I tried to create a python-sudo.sh (like screenshot below) and let the PyCharm use this as Project Inerpreter, but it ends up with error
user posted image
Anyone can help with this, a video tutorial or remote, please? icon_question.gif
Thanks in advance
*
Either you launch your pycharm as root user, or you change the project folder and files permission to your current user.


TSk town shit
post Mar 22 2020, 07:08 PM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(kmc3388 @ Mar 22 2020, 02:00 PM)
Either you launch your pycharm as root user, or you change the project folder and files permission to your current user.
*
Yes, as u can see in my initial post, I know that I need to launch PyCharm as root user.
So my question is How to launch PyCharm as root user, rather than what to do to modify the code.
Could u please post a relevant reply? If u have one. Rather than post irrelevant comment
TruboXL
post Mar 22 2020, 09:44 PM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



1. your way

https://www.jetbrains.com/help/pycharm/work...mmand-line.html

let you figure out yourself

2. change /odoo-13c so that you dont need to use root account, hint: chown, chmod

3. https://www.odoo.com/forum/help-1/question/...-aborting-63567

edit: 3rd is best


http://www.odoo.com/documentation/10.0/setup/install.html

This post has been edited by TruboXL: Mar 22 2020, 09:56 PM
TSk town shit
post Mar 23 2020, 11:27 AM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 22 2020, 08:44 PM)
1. your way

https://www.jetbrains.com/help/pycharm/work...mmand-line.html

let you figure out yourself

2. change /odoo-13c so that you dont need to use root account, hint: chown, chmod

3. https://www.odoo.com/forum/help-1/question/...-aborting-63567

edit: 3rd is best


http://www.odoo.com/documentation/10.0/setup/install.html
*
I read through the posts, none of them applicable, as they never show the step by step of how to do it. I'm stucked.
TruboXL
post Mar 23 2020, 11:35 AM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



do you know where you installed pycharm to? how to launch pycharm through terminal?
TSk town shit
post Mar 23 2020, 11:54 AM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 23 2020, 10:35 AM)
do you know where you installed pycharm to? how to launch pycharm through terminal?
*
I think my PyCharm wast installed in /home/ralph/.PyCharmCE2019.3
I didn't know how to launch PyCharm through terminal, I saw there is a video about using gksu to launch app, but when I apt-get install gksu, it shows error
TruboXL
post Mar 23 2020, 11:59 AM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



QUOTE(k town shit @ Mar 23 2020, 11:54 AM)
I think my PyCharm wast installed in /home/ralph/.PyCharmCE2019.3
I didn't know how to launch PyCharm through terminal, I saw there is a video about using gksu to launch app, but when I apt-get install gksu, it shows error
*
its been a long time already, i dont think there's gksu in ubuntu anymore
i also do not think that's the path pycharm installed to, more like that's where pycharm store its config files...
TSk town shit
post Mar 23 2020, 12:22 PM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 23 2020, 10:59 AM)
its been a long time already, i dont think there's gksu in ubuntu anymore
i also do not think that's the path pycharm installed to, more like that's where pycharm store its config files...
*
It's in here /snap/pycharm-community
user posted image
TruboXL
post Mar 23 2020, 02:13 PM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



ugh, I lack of experience in dealing with snap

let's try to dissect how pycharm desktop shortcut works...

find /usr/share -name *.desktop | grep -i pycharm

to find pycharm shortcut file that used to open pycharm using mouse click
TSk town shit
post Mar 26 2020, 02:13 PM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 23 2020, 01:13 PM)
ugh, I lack of experience in dealing with snap

let's try to dissect how pycharm desktop shortcut works...

find /usr/share -name *.desktop | grep -i pycharm

to find pycharm shortcut file that used to open pycharm using mouse click
*
Pardon me for a noob question,
I tried to understand what you said but not able to, in which file in the /usr/share that you want me to check the file?
user posted image
TruboXL
post Mar 26 2020, 03:02 PM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



QUOTE(k town shit @ Mar 26 2020, 02:13 PM)
Pardon me for a noob question,
I tried to understand what you said but not able to, in which file in the /usr/share that you want me to check the file?
user posted image
*
"find" is also part of the command
"find" will search "/usr/share" folder to for names that have ".desktop" extension, "grep" handles filtering for names with "pycharm"
TSk town shit
post Mar 26 2020, 11:58 PM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 26 2020, 02:02 PM)
"find" is also part of the command
"find" will search  "/usr/share" folder to for names that have ".desktop" extension, "grep" handles filtering for names with "pycharm"
*
Seems like so such file:

user posted image


icon_question.gif
TruboXL
post Mar 27 2020, 02:03 PM

BOINC
****
Junior Member
514 posts

Joined: Jan 2016
From: Kota Tinggi, Johor



*sigh* I guess I have to fire up a VM to test myself...

Also now I really know why I hate snap...

the correct way: https://esmithy.net/2015/05/05/rundebug-as-root-in-pycharm/

the not correct way: sudo /snap/bin/pycharm-community
TSk town shit
post Mar 27 2020, 05:58 PM

Casual
***
Junior Member
474 posts

Joined: Jan 2009
QUOTE(TruboXL @ Mar 27 2020, 01:03 PM)
*sigh* I guess I have to fire up a VM to test myself...

Also now I really know why I hate snap...

the correct way: https://esmithy.net/2015/05/05/rundebug-as-root-in-pycharm/

the not correct way: sudo /snap/bin/pycharm-community
*
I tried with this
QUOTE
sudo /snap/bin/pycharm-community

It really works... haha
Btw, I'm thinking about to uninstall the PyCharm because Snap made it so difficult to change my source code
Do you have a recommended way to install PyCharm?
Thanks
kmc3388
post Mar 31 2020, 08:20 PM

New Member
*
Newbie
7 posts

Joined: Nov 2014
QUOTE(k town shit @ Mar 22 2020, 07:08 PM)
Yes, as u can see in my initial post, I know that I need to launch PyCharm as root user.
So my question is How to launch PyCharm as root user, rather than what to do to modify the code.
Could u please post a relevant reply? If u have one. Rather than post irrelevant comment
*
I did want to help. But you just glancing through my reply, without giving much thoughts, and thought that it's irrelevant reply. Just waiting for spoon fed for answer instead of really understanding the problem that you have.

It's a bad practice to run everything as root, which is what you are doing right now.

You can just change your project file and folder to your user and group with chown -R $UID:$PID <your proj folder>, instead of running your program as root.

As for snap. just call snap run <bin name>. Or put sudo in front to run as root.

want to know where is your binary in your path? just do 'which <bin>'.



Start asking the right questions.

 

Switch to:
| Lo-Fi Version
0.0213sec    0.45    5 queries    GZIP Disabled
Time is now: 2nd April 2020 - 02:39 AM