4

I've been developing Python code for my RPi from my Mac. It's simple: I've installed XQuartz on the Mac, idle3 on the RPi, ssh -Y ... to the RPi from the XQuartz terminal, then idle3 & to access idle3 on my Mac's desktop as it runs on the RPi.

This works reasonably well, but I've developed a case of "feature lust" for some of the "professional" IDEs, so I read some reviews, and chose two commercial IDEs as most likely to succeed because they made strong claims for supporting "remote development" and "remote host execution". I began my evaluation about 10 days ago.

To my way of thinking, neither of these commercial IDEs actually do what they say wrt remote development and remote host execution. I'll illustrate what I mean with this very simple code snip:

import os
keyval = os.environ.get('MY_ENV_VAR')

My existing setup (XQuartz & RPi-hosted idle3) handles this fine. Both of the other commercial IDEs fail to return a value for keyval, nor do they raise an exception/error. Maybe it's just me, but this doesn't seem like good support for remote development and remote host execution. I've been in touch with both vendors' tech support, and it seems they can't really execute this code on the RPi, but instead offer "work-arounds".

So finally, here's my question: Does anyone know of a "full-featured" IDE that supports Python (other languages would be nice, too) that really and truly support remote development and remote host execution?

  • Is this a possible case where the free or trial doesn't support remote Dev and execution, but the paid or full or pro version does support that? I don't know too much about those IDEs and just posting a general thought as many IDEs will have a free or trial with less features to get you to buy the full or pro stuff. Also, with remote Dev, could you not just setup a shared folder on your RPi and access that like a network device on your Mac? I have Samba on my RPi and made a drive on my windows laptop to the folder on my RPi? Again, just a thought, but it doesn't solve the remote execute. – Keith E. Truesdell Apr 25 '18 at 3:45
  • No, that's a good thought, but that's not it. I've got an "eval" version that supports "remote development" and "remote host execution" :) – Seamus Apr 25 '18 at 22:03
  • Xojo has Remote Debugging that you can use to develop on Mac and then run your app on the Pi through the IDE in debug mode so you can set breakpoints and step through code. More information about that here:developer.xojo.com/rpi-remote-debugging – Paul Lefebvre Sep 21 '18 at 17:48
  • @PaulLefebvre: Thanks for the referral. I've just read through the link, and the "Remote Debugger Desktop" worries me because I run my RPi "headless", so I have no desktop, Also, do you know if it will pass my simple "test" for getting an environment variable? – Seamus Sep 24 '18 at 11:50
  • There is also a "Console" remote debugger that ought to work for headless setups. Your code actually runs on the Pi itself and you have access to the system shell so I'd expect you'd be able to do what you describe, but I'm no expert on the Pi, shell or environment variables. If you can download it can give it a quick test. – Paul Lefebvre Sep 24 '18 at 20:12
2

You can use Jetbrains softwares. They have all kinds of IDEs. For python, there's Pycharm IDE. There's a paid or free version but with the free version you don't have the remote development feature.

  • How long have you used JetBrains? – Seamus Apr 25 '18 at 22:01
  • I used it about 2 years – Kreumz Apr 26 '18 at 3:30
  • Here's what I wonder about w/ JetBrains' PyCharm: \n1. It won't read environment variables I set in .profile, \n2. it creates a folder for "helper apps" on my RPi that is 30 MB in size, and contains 740 files. – Seamus Apr 27 '18 at 2:11
2

I don’t speak from experience but I have met developers who use Vim for commercial grade software products.

I understand you would combine SSH with Vim to achieve your remote development and build capability.

This approach requires a lot of configuration. Check out this Wiki for some productivity ideas:
http://vim.wikia.com/wiki/Use_Vim_like_an_IDE

2

With Xojo you can use the Remote Debugger to run code directly on the Pi.

2

Your code snippet is not as simple as you may think.

Environment variables are set separately for each process (possibly with inheritance), so if you set MY_ENV_VAR in a shell and test for it from the same shell (with Python code or otherwise) it will be set. If you run Python from a different shell, it won't be. Even in the same shell, you may lose environment variables if you spawn a process in a way that won't inherit them. For instance, sudo -u pi python ./myscript.py will not inherit MY_ENV_VAR, yet it's a perfectly sane approach for a remote IDE to spawn a process with a specific user ID.

The above assumes that you have access to the shell that your IDE is using as a remote session, and set the variable there. This may not be the case. IDEs can start their own login shell, their own subshell, or start processes with no shell at all, and in case of login shells they may log in as a user you don't expect. If you set MY_ENV_VAR in your .bash_profile, it will be set if you login as pi but it will not be set if you start a non-interactive shell as in ssh pi@raspberry.local python ./myscript or a subshell as in sudo -u pi bash. Needless to say, MY_ENV_VAR will not be set if the IDE uses a different user for remote execution, which may not even use bash as a login shell.

In essence, whatever an IDE does to execute a process remotely, you can always find a case where it doesn't have the same environment as a local process. You have to find out how to set variables in a way that is compatible with an IDE of your choice, and stick to that approach.

  • My code snippet is more counterexample than general test. The IDEs I tested were unable to simply retrieve environment variables I had manually stored in /home/pi/.profile. Instead, they required I re-enter the values in the IDE. Remote Development & Remote Host Execution means that I can test my system from the IDE; this is not convoluted logic. Notwithstanding your insightful explanation, I'm still looking for an answer to my question: What IDEs support remote development and remote host execution? – Seamus Nov 12 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.