Pycharm launches "Debugger speedups using cython" in a docker-hosted application

I have a strange problem that I cannot understand. My django project is configured using docker-compose

version: '2' services: db: image: postgres:9.6.0 environment: POSTGRES_PASSWORD: docker POSTGRES_USER: docker ports: - "8001:5432" djweb: build: . command: python dj/manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db 

and docker file

  FROM python:3.5.2 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ 

In Pycharm, I launched a new Django project, configured with docker compose, and it was created just fine. When I try to debug it, I get the usual one:

warning: debug acceleration using cython not found. Run '/ usr / local / bin / python "/opt/.pycharm_helpers/pydev/setup_cython.py" build_ext --inplace' for the assembly. pydev debugger: process 1 connects

And now the problem. It seems I cannot run this setup_cython command, which Pycharm offers on my djweb container due to a strange read-only error. I would appreciate if someone could point me in the right direction (I probably need to add some volume to my container or ??? - obviously, pycharm also adds other images / containers along with mine)

root @ b8bf92996472: / # "/ usr / local / bin / python" "/opt/.pycharm_helpers/pydev/setup_cython.py" build_ext --inplace
continued build_ext building '_pydevd_bundle.pydevd_cython' extension build creation error: failed to create 'build': read-only file system

+7
docker pycharm
source share
1 answer

I ran into the same problem and was able to solve it using the command as follows:

 docker run -t -i --volumes-from pycharm_helpers_PY-163.10154.50 IMAGE_NAME \ /usr/bin/python /opt/.pycharm_helpers/pydev/setup_cython.py build_ext --inplace 

You will most likely have to replace 163.10154.50 with your own instance - I found 163.10154.50 in PyCharm → ViewTool WindowsDocker , in the appeared view, under DockerContainers .

IMAGE_NAME can be found with docker ps

Note. In my configuration, I use a docker machine and must first run eval $(docker-machine env) from the terminal.

+8
source share

All Articles