Closed DonJayamanne closed 5 years ago
I would really like to see this too.
When it comes to running Python inside of a Docker container it would be really neat if we could just set:
"python.pythonPath": "docker-compose exec web /usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "docker-compose exec web /usr/local/bin/flake8",
That above pattern could technically be applied to all extensions, not just Python.
I tried this now and it doesn't find Python even though it's there in the container. In this case web
is a container that has Python and all of the app's dependencies installed (including flake8
).
we like to see this feature as soon as possible , i see that many people waiting for this feature from long period , technologies is moving fast , docker gives us nice dev environnement .... vs code should benefit from it as soon as possible .
Hi everyone, this is on our roadmap. However before we move into this space there's a lot more engineering work that needs to be done, and we're in the process of doing this amongst other items.
@DonJayamanne are your engineering efforts being applied specifically to Python or are you looking into ways so that Dockerized runtimes work for all VSCode supported languages?
Hello @DonJayamanne, it's been a while since I gave feedback on this issue. I've read that this issue is already on the roadmap, but is there a launch window date for this feature?
Thanks for any feedback in advance.
Regards.
but is there a launch window date for this feature? Sorry, we don't have any dates yet, we'll keep you posted when this becomes available. FYI - we've been busy working on a new and improved debugger for VS Code, along with resolving a number of intelliense related issues this month. Once we have date I'll be sure to post it in here.
Hi! Just a great high-five if this starts working! Going to and from between pycharm and vscode and am missing this feature sorely on vscode (I use docker container environments). If I had to vote for one feature addition, this would be it! Being able to go to definition etc.....!!
What I've being doing as a workaround for docker is a symlink to the virtualenv folder inside the container when running my app.
I'm finding the container folder using the process id.
ln -f -s /proc/`pgrep -nf "manage.py runserver"`/root/home/user/virtualenv .venv
then on my workspace settings I've "python.pythonPath": ".venv/bin/python"
+1 on this from us. This is the biggest blocker in moving from pycharm
@pardo Interesting hack! But even after finding the PID and the symlink, vscode go to definition or peek at definition doesn't seem to work for me. Do these work for you? Thoughts?
jedi might have issues with symlinks (but I'm not sure 100% of it). So I use sshfs hack which I described somewhere above.
+1 on first post, using a Docker container as remote interpreter is the proper way to go. Conda, MacPorts or any other similar tools will never match the flexibility of a CentOS/Fedora container environment, where you install all your Python rpm package dependencies in a snap.
There is orthogonal approach - move vscode in the container or mutable remote dev server.
I like it because I prefer dev environments on remote servers.
@pardo that is one binary. What about all the import
requirements you need on a fairly advanced microservice.
@DXist it's ok if your remote dev server is on the same local network with your local machine. But in case of a remote server over the Internet typing latency will kill the productivity.
+1 for the interpreter on docker container
+1 for the general remote interpreter support
+1 for docker container on remote server
+1 for the interpreter on docker container
I work with PHP and Python, till now I used PHPStorm and PyCharm. Recently I started developing PHP projects with VS Code since they are run on my server, but with Python I work with dockers, a lot of libraries are set up in dockers and I need code inspection of imports refering to in-docker libs. Right now I have te renew subscription of Pycharm because VS code lacs of this feature.
yep, this
+1 for the general remote interpreter support
another +1 (from smb whose colleagues are moving to pycharm basically because of their remote python interpreter support)
+1. Evaluated VSC to see whether I could move over from PyCharm, but without this feature (or something that allows libraries inside of my docker container to be referenced) it's not a viable option over PyCharm right now.
The linters error (due to 'missing' libraries) and code completion/introspection features don't work.
Add this feature and a lot of people will move over.
There is an article for remote debugging, https://vinta.ws/code/remotely-debug-a-python-app-inside-a-docker-container-in-visual-studio-code.html which refers to https://github.com/Microsoft/ptvsd . Maybe some idea from there can be used? Anyone have been able to test Django aswell with deugging from vs code with that approach?
I wished the team gave this max priority... :\
This is a must-have if you need to run code on a remote server.
+1 for the interpreter on docker container
However, having to install node.js on the remote server could be a deal breaker. A PyCharm-like approach would be better.
+1
+1
pytest-xdist uses execnet for running remote tests. Maybe we might use it as well. I hope I'll have time on a weekend to play with this more. anaconda-mode for emacs has ok remote intellisense capabilities, but having common cross-platform basis would be awesome.
+++1
+1 from me too, would love to use vscode but require an ssh interpreter
+1 for the interpreter on docker container
As noted earlier can we please stick to constructive informative comments that add to the discussion. This is a very noisy issue to subscribe to because of +1 comments.
Does the release of the new standalone Python language server mean this feature is imminent?
Im also hoping for this @jack-guy! Anyone who knows or has seen anything hinting to this?
+1
@DonJayamanne have you looked at the Hydrogen package that Atom uses? It connects to a remote Jupyter kernel, it worked great.
Configuration is easy. I’m switching from Atom to VSC and remote interpreter is the one key feature I miss.
Hi everyone, thank you for all the requests for remote interpreter support! We're currently looking into how best to support this and wanted to learn more about your needs, setup, etc.
If you could all take 3 minutes to fill out this survey it will be a big help to us: https://www.research.net/r/8D3MGDY
Is there a way to edit my responses? I hit “go” after the first question and apparently that submitted the whole thing. On Thu, Aug 30, 2018 at 13:47 Dan Taylor notifications@github.com wrote:
Hi everyone, thank you for all the requests for remote interpreter support! We're currently looking into how best to support this and wanted to learn more about your needs, setup, etc.
If you could all take 3 minutes to fill out this survey it will be a big help to us: https://www.research.net/r/8D3MGDY
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode-python/issues/79#issuecomment-417407776, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHe9EBvfRinjvVJyAovb6-pTk8NPTgNks5uWCUlgaJpZM4QceWL .
@northisup I’m not seeing that issue when I hit go but you can submit another survey (might need to use incognito) and I’ll try to discard your first one, sorry about the trouble!
@NorthIsUp just scroll up the page.
Thanks. Incognito worked. On Thu, Aug 30, 2018 at 15:43 Peter Zhang notifications@github.com wrote:
@NorthIsUp https://github.com/NorthIsUp just scroll up the page.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode-python/issues/79#issuecomment-417443721, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHe9I2Vbriui2mYqQW7gYYPJsfnZYtSks5uWEBzgaJpZM4QceWL .
@qubitron What is the expected timeframe on this? My pycharm license is about to run out 😜
hi guys, we are actually using VSCode to debug an application running in a Docker VM. It is working brilliantly actually. I will talk from the python perspective, since we use python.
(its a standard wsgi script)
once flask shell starts, i run the following to start the vscode debug server on the application side
import ptvsd
ptvsd.enable_attach( address = ('0.0.0.0', 6000))
ptvsd.wait_for_attach()
open the debugger (ctrl+shift+d), choose "Python Attach" from dropdown and press green arrow. It will connect to docker . Docker will proceed and uwsgi will start fully.
debugger is active.
We have all moved away from pycharm over the past month.
What about linting against remote python environment?
@sandys This sounds great, but from what I can tell this won't help me run my code on a remote server? With pycharm I can simply SSH to there, and deploy my code. This works great, since I'd also rather not run everything in a docker
my particular comment (and indeed this entire bug) is around remote debugging.
However, what you said should be possible using stuff like - https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs however I'm not sure since i dont use it.
On Tue, Sep 4, 2018 at 2:08 PM LaurensHagendoorn notifications@github.com wrote:
@sandys https://github.com/sandys This sounds great, but from what I can tell this won't help me run my code on a remote server? With pycharm I can simply SSH to there, and deploy my code. This works great, since I'd also rather not run everything in a docker
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode-python/issues/79#issuecomment-418287352, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEsU9lTgR5nJQsU60DN8OLXwS3RTE-Mks5uXjvmgaJpZM4QceWL .
That looks good, and solves part of the problem, but I actually also want to run/debug the code on that remote machine.
From @satyenr on May 13, 2016 3:37
The ability to run code on a remote machine is awesome. You can develop on a Windows PC or a Mac while running and debugging on a remote Linux server. PyCharm supports such a feature - https://www.jetbrains.com/help/pycharm/2016.1/configuring-remote-python-interpreters.html.
Having a remote interpreter also helps when the remote machine already has a functional Python environment - possibly managed by someone else - which you don't want to/can't replicate on your local machine.
Copied from original issue: DonJayamanne/pythonVSCode#123