How to change docker mapped path for docker interpreter in pycharm ?
By default, project path is mapped to `/opt/project`, may I know if there's way to change it ? Things tried
1. update container settings in run configurations to add another -v host_path:container_path, not working
2. try to add a path mapping in docker deployment, not working.
Advice is highly appreciated.
Thanks !
Please sign in to leave a comment.
>update container settings in run configurations to add another -v host_path:container_path, not working
Why add another? Have you tried to simply change the existing mapping entry?
I tried, but it doesn't work. I also tried to add another mapping from the ui you show, it didn't work either. I am on pycharm 2019.3 professional edition
>I also tried to add another mapping from the ui you show, it didn't work either
Works on my side. Can you please show a screenshot of your run/debug configuration and copy-paste the output of the run console when you run that configuration? E.g., assuming I've changed from /opt/project to /tmp/foo, then it should say:
391e018e01a8:python -u /tmp/foo/app.py
I guess it is because I ticked Run with Python Console Without enabling it, it works fine.
This is python console output.
This is my configuration. W
This is the output without enabling python console.
101acd48f9f1:python -u /somepath/test.py
/somepath
testing docker file
```
```
testing script
```
```
when enabling python console, I can get it to work by changing configurations.
and the console looks normal
but volume mount seems to be wrong
Since you're running with python console, have you tried changing mappins in [File | Settings | Build, Execution, Deployment | Console | Python Console] settings?
You should specify path mapping and the working directory there, then it should work.
I tried
docker path mapping
-v /Users/user/Desktop/code/demo:/workspace
python interpreter mapping
/Users/user/Desktop/code/demo=/workspace
working directory: /workspace
Can you be more specific on configuring it ? thanks !
it doesn't work.
/workspace is still not mounted
Same problem here. Also I can't change the path in the target host without PyCharm messing with the path of my local host (I'm on Windows).
- Pre-change: `C:/my/project | /opt/project`
- Post-change (only changing the right part, left gets updated): `C:\my\project | /opt/project`
Then running my tests I get this error:
Error running 'Unittests for test_db.TestDB': Cannot run the remote Python interpreter: Status 500: \c\my\project%!(EXTRA string=is not a valid Windows path
Trying to be too smart, please let us mofify a field without updating another!
Thrastylon Could you please create a bug report at https://youtrack.jetbrains.com/issues/py with steps to reproduce the issue and some screenshots?