Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Using coc-python with a python inside of a container #85

Open
ghost opened this issue Sep 4, 2019 · 3 comments
Open

Using coc-python with a python inside of a container #85

ghost opened this issue Sep 4, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 4, 2019

I am editing a file outside of a container, but using libraries (fenics) that are inside the container. Obviusly I get a [Python unresolved-import] [W] unresolved import 'fenics'. How can I tell coc-python to use the python that is inside the container? Thanks.

@doronbehar
Copy link

Could you mount the container's Python environment and put that environment's bin/python available in your $PATH?

@harryjubb
Copy link

harryjubb commented Oct 3, 2019

Could you mount the container's Python environment and put that environment's bin/python available in your $PATH?

Docker-specific here: As I understand it, it's possible to mount from the host into the container with bind mounts, but not from container to host. If you make a bind mount of a host folder to the container Python, the host folder contents overwrite the container's contents.

I'm not clear on if it may be possible with Docker volumes where the docs imply this condition may not be the case, but I'm not clear on whether it's then possible to access that volume on the host, everything I've seen suggests it can only be accessed via a container.

This must somehow be possible though as PyCharm does it somehow via (apparently) connecting through the Docker daemon with TCP.

@smatting
Copy link

smatting commented Oct 8, 2019

I'm trying to solve the same problem. I already tried setting python.pythonPath to a wrapper-script that spawns a docker container running the container's python interpreter. The result is that coc-python starts the wrapped script, but still prompts to choose an interpreter. So that doesn't seem to work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants