简体   繁体   中英

Running Docker in PyCharm using Windows and virtualenv (Tensorflow)

I am trying to run Docker in my PyCharm project. My PyCharm project uses Python 2.7, whereas the system default Python is 3.4. I installed Docker through this tutorial. I start the Docker engine using in my virtual env of Python 2.7:

docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow

I can access it through my browser using http://192.168.99.101:8888 and it executes Python 2.7 code.

Now I want to use Docker in my existing PyCharm 2.7 project. (note that I use Anaconda and that I use plenty of packages which I would like to keep).

Is there any way to run the Tensorflow Docker Image in my PyCharm project? (any other solution to run Tensorflow in PyCharm is fine as well).

Yes, you can tell PyCharm to use a interpreter inside a docker container. This, however, only works with PyCharm Professional.

First, go to Preferences -> Project Interpreter (under Project: ...) and click on the gear or dots to the right of Project Interpreter near the top. In the Configure Remote Python Interpreter dialog, click the Docker button.

https://blog.jetbrains.com/pycharm/2015/12/using-docker-in-pycharm/#make-pycharm-docker-interpreter

Follow this tutorial , particularly API section for api url. Below settings work fine for windows10.

Note: works only with Professional Edition

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM