Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPath not respected in remote container #1579

Closed
syagev opened this issue Oct 2, 2019 · 1 comment
Closed

pythonPath not respected in remote container #1579

syagev opened this issue Oct 2, 2019 · 1 comment
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@syagev
Copy link

syagev commented Oct 2, 2019

  • VSCode Version: 1.38.1
  • Local OS Version: Window 10 1903
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type: Docker

Steps to Reproduce:

  1. Create a project with pipenv
  2. In the folder settings.json point pythonPath to the python interpreter in the virtualenv (i.e. something like C:\Users\username\.virtualenvs\SomeProject-09hncfd\bin\python.exe
  3. Create a custom Dockerfile based of Ubuntu 18.04 and build image (e.g. my-image:latest), in this image create a virtualenv based on the project's Pipfile using pipenv. Assume the virtualenv (in the image) is created at /root/.local/share/virtualenvs/SomeProject-1298hf
  4. Setup remote like so:
"image": "my-image:latest",
"settings": {
  "terminal.integrated.shell.linux": "/bin/bash",
  "python.pythonPath": "/root/.local/share/virtualenvs/SomeProject-1298hf/bin/python",
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true,
  "python.linting.pylintPath": "/root/.local/share/virtualenvs/SomeProject-1298hf/bin/pylint"
},
  1. Open VSCode remote, run the project.
  2. An error message appears: "You need to select a Python interpreter ..."

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

In remote mode, VSCode doesn't seem to respect the pythonPath settings - it does not find the python in the virtualenv (although it's there). In the terminal the project can be run using either one of these commands:

  1. pipenv run myscript.py from the project's folder, or
  2. /root/.local/share/virtualenvs/SomeProject-1298hf/bin/python myscript.py

However in the Python Interpreter Selection only the system's Python installs appear (/usr/bin/python3, /usr/local/bin/python3)

Possibly related:
#187
#141

@chrmarti
Copy link
Contributor

Closing in favor of microsoft/vscode-python#7813. Thanks.

@chrmarti chrmarti added the *caused-by-extension Issue identified to be caused by an extension label Oct 21, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

2 participants