PyCharm: Can't create remote python interpreter using docker-compose - macos

On attempt to create docker-compose python interpreter in PyCharm I get error:
Error while parsing "/Users/belek/Projects/project/docker-composee.yml": Process docker-compose config failed.
Itself docker-compose works fine. The docker-compose config command running in terminal works too.
Before updating macOS and PyCharm I was using docker-compose python interpreter succesfully. Can't understand what's wrong. I created issue in JB YouTrack, but no response.
PyCharm 2019.2.3
macOS Catalina 10.15

The following helped me.
Go to 'System Preferences' -> 'Security & Privacy'.
Add PyCharm to "Full Disk Access" and to "Developer tools".

Related

docker-compose command not available for mac

I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

docker commands not found

I installed docker in Mac and it is installed successfully.
Also it is running.
And tried to execute the below command in terminal
docker -v
See the below error:
-bash: docker: command not found
How do I solve this issue.
In windows those commands are working fine.
If you successfully installed docker using the official package, the command should be available under /usr/local/bin/docker.
That directory might not yet be in your $PATH, so you could try adding export PATH="/usr/local/bin:$PATH" to your .bashrc / .bash_profile.

ERROR:browser_gpu_channel_host_factory.cc(121)] Failed to launch GPU process

i am trying to configure debugging port for google chrome extension for Visual studio for client side debugging in terminal using below commands and getting the below error,
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
[96138:85251:0321/103001.249367:ERROR:browser_gpu_channel_host_factory.cc(121)] Failed to launch GPU process.
Created new window in existing browser session.
i have tried export BROWSER=google-chrome too, but its not working. i hope i have to type this command in terminal . I am using MAC high Sierra , How can i resolve it.
I had a similar error when working with the bokeh python3 library on Ubuntu 16.04. I found a solution on a thread for jupyter notebook on github.
From: Github Issue
I had this same error
("ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU
process"). After running jupyter notebook, I would get a new tab in
google-chrome, but it would be blank.
Following but slightly modifying #wewan's advice, I ran "export
BROWSER=google-chrome". Then running jupyter notebook worked as
expected. I am using Ubuntu 16.04, Google Chrome 62.0.3202.62, and
Jupyter 4.3.0. Also, if this works, you'll obviously want to add the
export command to your .bashrc or .bash_profile
I did a raw export at the command line, and it corrected my issue.
export BROWSER=google-chrome
If this works, you will want to add this to your profile. I am not well-versed with Macs, but I believe there is a .bashrc file to which you can add the export.

Pycharm docker remote python interpreter

When trying to configure a Remote Python Interpreter in Pycharm using Docker I get the following error:
com.github.dockerjava.api.excepion.DockerClientException: Enabled TLS
verification (DOCKER_TLS_VERIFY=1) but certificate path
(DOCKER_CERT_PATH) '/Users/me/.docker/machine/machines/default'
doesn't exist.
I've $export DOCKER_TLS_VERIFY=0 but with no difference.
I've manually created '/Users/me/.docker/machine/machines/default' but with no joy.
I've deinstalled and reinstalled both Docker and Pycharm but still get the same error.
I'm on a Mac OSX 10.12.1
Pycharm 2016.3
Full disclosure: I use vagrant and virtual box on my mac too.
Any pointers would be appreciated.
Kevin
I fixed it as follows:
Obtain socat (if not already installed)
e.g. brew install socat
Then: socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
Then in pycharm/docker config:
Api URL: tcp://localhost:2375
Many thanks to the following found on:
https://youtrack.jetbrains.com/issue/IDEA-153973
If you have been using docker-machine for Mac to support PyCharm or the "socat" hack to access Docker API - It is no longer necessary with PyCharm EAP (https://www.jetbrains.com/pycharm/nextversion/) — You can set your remote debugger API_URL directly to: unix:/var/run/docker.sock (supporting debug mode, and the environment runs a lot faster, when not using VirtualBox).
There is a no-questions-asked 30 day trial of EAP before that update goes live (some time this month)

How do I Debug a Flask app in PyCharm with the Docker for OSX Beta?

I was previously able to debug my Flask application in PyCharm 16.1 with the Docker Machine. I could build the Docker container and then specify it as a remote Python interpreter. I recently upgraded Docker to use the Beta for OSX where it's able to run natively and no longer requires the docker-machine VM. After reading through a related question here: Where is the certificates folder for Docker Beta for Mac I am still having issues when I try and debug.
I have the 2.3.2 Docker plugin for PyCharm and PyCharm build 162.1237.1. It now informs you to run the command
socat TCP-LISTEN:2376,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
when you try to enter unix:///var/run/docker.sock as the Docker API URL. After doing this (and pointing the URL to tcp://localhost:2376) the server connects to the Docker Beta system and allows u to select an available container image as the remote interpreter. However, when you try and debug the application it gets stuck 'waiting for connection' while connecting to the debugger. In this scenario PyCharm does start the Docker container and if I exec into the container I can run ps aux and see:
python -u /opt/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client 10.0.2.2 --port 61276 --file /opt/project/app.py.
The file /opt/project/app.py is in the container and I can successfully start the flask app by running python /opt/project/app.py. How do I get PyCharm to successfully run this file and connect the debugger so I can step though the code in the IDE, for example.

Resources