A 3-post collection

Enable Docker Remote API

Do you know that docker doesn't allow remote API as default. So, if you want to use the remote interpreter feature of PyCharm, you are out of luck out of the box.

In which case, you have to enable it first... here is how you do it.

the original article is here

First thing, let's see the docker status first:

sudo systemctl status docker  
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/docker.service.d
   Active: active (running) since จ. 2017-02-27 14:10:48 ICT; 4min 16s ago
 Main PID: 10750 (dockerd)
   CGroup: /system.slice/docker.service
           ├─10750 /usr/bin/dockerd -H fd://
           └─10768 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-cont

... so much more ..

In CGroup, you will see that the dockerd is run with almost no arguments.

We might expect it to be like this instead to allow the local connection to the dockerd via a tcp port:

***** dockerd -H tcp:// -H unix:///var/run/docker.sock

To realize that, we have to edit how the dockerd is started:

sudo systemctl edit docker  

Will open an editor editing a specific newly generated configuration file, which by the way should be blank in this case.

Add these lines:

ExecStart=/usr/bin/docker daemon -H tcp:// -H unix:///var/run/docker.sock  

To take effect, restart the daemon:

sudo service docker restart  
อ่านต่อ »

Pycharm with Docker Remote Interpreter Hangs

Update: It has been solved in *Python 2017.1 EAP*

I reported the issue at

I use Docker for Windows on Windows 10 with Hyper-V Docker version 1.13.1, build 092cba3
Docker image: phizaz/sklearn (basically installs numpy, scipy, scikit-learn) Using this image, PyCharm will slowly update the skeleton and even the bar is full it won't finish, I even left the computer for a day and it didn't finish.

Here is the captured screenshot:

I think it might relate to this issue as well:

Because not only it won't finish, sometimes I encountered Pycharm not responding, as even so Docker not responding as well. (after closing Pycharm docker became responsive as usual)

For now, I'll use 2017.1 EAP instead.

อ่านต่อ »

Bye ... PyCharm, Hello LiClipse

PyCharm is my best Python IDE.

I make the switch because of one one reason. Since I've been using Dvorak for quite sometime, PyCharm just don't support it properly, PyCharm key mapping doesn't work with alternative keyboard layouts (even though they blamed it wasn't their faults).

I had been using PyCharm with some workaround (karabiner) since the beginning. I wasn't quite satisfied, but at least I can get my job done. But not anymore, since I updated OSX to macOS Sierra, karabiner has stopped working, my only workaround has gone. Any attempt I made for other alternatives just didn't seem to be fruitful. So, I decided to abandon PyCharm.

Now, I'm on LiClipse, actually I want to go with Eclipse + PyDev. But, it recommends me to this IDE, so I will just go with that.

อ่านต่อ »