我了解以下 docker server start 允许我访问 jupyter notebook
docker pull tensorflow/tensorflow:latest-py3 # Download latest stable image
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-py3-jupyter # Start Jupyter server
我的问题是如何更改 pycharm 中的解释器来使用它?
最佳答案
将 pycharm 附加到 tensorflow/tensorflow:latest-py3 图像应该相当简单。
Go to File ->
Settings ->
Project ->
Select interpreter ->
Click the Gear ->
Add ->
Select Docker ->
Create a unix Socket
Choose tensorflow/tensorflow:latest-py3 as Image name and your might need to edit the Python interpreter path based on the image.
要获取 python 路径,您需要通过以下方式启动 shell 或 bash:
docker exec -it container_name sh
docker exec -it container_name bash
要获取您可以使用的容器名称
docker container ls -a
终于在 bash 中像这样的东西可能会起作用
python -c "import sys; print(sys.path)"
关于python - 如何设置pycharm解释器使用docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62590549/