简体   繁体   中英

How to solve PyCharm error with docker "can't open file 'path/to/file.py': [Errno 2] No such file or directory"?

There is a server in the network, where our docker containers images are. I have build the image in the server, then on PyCharm I tried to follow the steps here , I could select the Docker settings, it shows the image that I have just created, let's say a image named 'teste1', I can see that all my libs were installed.

Until here everything is OK. But when I click to run any script from my project it shows the message:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/project/zoro/run_pipeline_and_persist.py'.

I have read an answer here about it, but didn't worked.

PyCharm version 2019.3

This setup (container on the remote machine) is not "natively" supported by PyCharm at the moment, unfortunately.

In the meantime, you can configure it to work with some extra clicks, please see the instruction in PyCharms' bug tracker (and vote for the ticket) https://youtrack.jetbrains.com/issue/PY-33489

Basically you need to configure the deployment configuration alongside remote Docker interpreter and tweak path mappings.

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