Hans
Hans

Reputation: 101

Python console within Pycharm in a Ubuntu Virtualbox fails to connect

I'm using Aldryns environment to develop a django-cms site.

I'm on windows 10, which isn't perfect, so I created a virtual machine Ubuntu 16.04 with Virtualbox. Within the VM, I installed Pycharm 2016.1.3.

Aldryn support (who are tireless) helped me to setup docker support for Ubuntu and Pycharm:

just create a file /etc/default/docker containing:

DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://127.0.0.1:2376"

Drop the following into /etc/systemd/system/docker.service.d/daemon.conf

(create directories if they don't exist yet):

[Service]    
    EnvironmentFile=/etc/default/docker    
    ExecStart=   
    ExecStart=/usr/bin/docker daemon $DOCKER_OPTS

Then issue the following two commands:

sudo systemctl daemon-reload 
sudo systemctl restart docker

Now Pycharm is able to see within the docker container. I.e. the Project Interpreter nicely shows all installed packages.

I did do all this, so I would be able to use the python console from Pycharm.

(ERROR: Interactive mode is not yet supported on Windows.)

Now I get this error:

xyz_w:python /opt/.pycharm_helpers/pydev/pydevconsole.py 0 0

PyDev console: starting.

Couldn't connect to console process.

Process finished with exit code 143

Playing it via a terminal gives:

me@my-VirtualBox:~/xyz$ docker-compose run --rm web python manage.py shell 

/app/addons/aldryn-django/aldryn_config.py:56:

RuntimeWarning:

no cache configured. Falling back to CACHE_URL=locmem://
RuntimeWarning,

Django not found.

Python 2.7.11 (default, Mar 3 2016, 10:57:12) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole)

How do I solve this problem, so I will be able to use the python console?

Upvotes: 4

Views: 675

Answers (1)

PEZO
PEZO

Reputation: 521

Uninstall docker integration plugin to get PyCharm's bundled version. (Make sure you have a new Pycharm version.)

Source: https://youtrack.jetbrains.com/issue/PY-18853#comment=27-1362538

Upvotes: 0

Related Questions