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

Virtualenv interpreter not found #38

Closed
odoo-sh opened this issue Oct 21, 2020 · 6 comments
Closed

Virtualenv interpreter not found #38

odoo-sh opened this issue Oct 21, 2020 · 6 comments

Comments

@odoo-sh
Copy link

odoo-sh commented Oct 21, 2020

Web Browser: chrome
Local OS: Linux Mint
Remote OS:
Remote Architecture: x64
code-server --version: https://hub.docker.com/r/linuxserver/code-server
Hello,

I have deployed the current code server using docker

docker run -d
--name=code-server
-e PUID=1000
-e PGID=1000
-e TZ=Europe/London
-e PASSWORD=sode1234
-p 8443:8443
-v /opt/coder-docker/config:/config
-*v /opt/app:/opt/app *
--restart unless-stopped
linuxserver/code-server

My application is in /opt/app and requires python interpreter.
I have created virtualenv using cmd below, such that i could mount this to code-server and work:
virtualenv -p /usr/bin/python3.7 --no-site-packages --always-copy /opt/app/my-app/venv

In code-server, I have added workspace folder /opt/app/my-app.
Created a python lauch.json, and selected the python interpreter to be added in settings.json.

{
"python.pythonPath": "/opt/app/my-app/venv/bin/python"
}

Code-server keep prompting "unable to find python interpreter".

What is wrong here?

Thanks,

@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the issue template!

@aptalca
Copy link
Member

aptalca commented Oct 21, 2020

Install the python3 mod. The image comes with only a minimal python install necessary to set up the main app. For all extra packages and environments, use the mods: https://github.com/linuxserver/docker-code-server#docker-mods

@odoo-sh
Copy link
Author

odoo-sh commented Oct 21, 2020

Redeployed the code-server with -e DOCKER_MODS=linuxserver/mods:code-server-python3 but the same issue.
My problem is,
I have mounted a volume containing venv and I am trying to use the python interpreter from this mounted volume venv.

@odoo-sh
Copy link
Author

odoo-sh commented Oct 21, 2020

Tested the workspace by running code-server in the host using systemd. Code-server auto-detect venv, activate the venv in the terminal, and select the right interpreter.

The purpose of choosing to run via docker is because I don't want to give access to the Host terminal and restrict the user to app directory.

@odoo-sh
Copy link
Author

odoo-sh commented Oct 22, 2020

I fixed my issue. Virtualenv created using --copies on Ubuntu 20.04 isn't compatible when we mount the venv folder to the docker-code-server. I have to create virtualenv in ubuntu 18.04. Thanks.

@odoo-sh odoo-sh closed this as completed Oct 22, 2020
Issue & PR Tracker automation moved this from To do to Done Oct 22, 2020
@skylarkprojects
Copy link

Hiya..

In the code-server terminal:

sudo apt-get update
sudo apt-get install libpython3-dev
sudo apt-get install python3-venv

worked for me

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

No branches or pull requests

3 participants