IntelliJ IDEA - how to map remote PYTHONPATH to local environment? - python

I'm using python remote interpreter in IntelliJ(13.1), and using "composes" modules which are installed on server.
By importing the module like follwing, I can use the module without any problem, but I get warn "No module named composes".
import composes
And I can't get the auto complete of the module in editor.
Do I need to map the remote PYTHONPATH to local?
If so, please tell me how to do that.

I found some documentation for this:
http://www.jetbrains.com/pycharm/quickstart/configuring_interpreter.html
I think best way is remote SSH interpreter. Check this out.
Edit: But don't forget. If you choose remote interpreter, you can't use your local modules.
Edit2:
1) Add deployment server from Tool->Deployment->Configuration
2) Add remote interpreter from File->Settings->Project Interpreter->Add remote And select the Deployment Configuration for FTP connection and can send to server your local files
3) And now you can upload your files to server from Pycharm. For this Right click to project folder->Upload to xxx. If all configuration is okay, now your files will upload to server and you can use auto-completion for your local files.
If it doesn't work, please try File->Invalidate cache. And let it delete all cache and download over it again.

Related

Pycharm Can't run remote python interpreter error

I have an aws ec2 instance to which I want to access and work via pycharm but I cannot correctly configure access to the remote terminal.
The steps I do are these:
using github and pycharm I clone the project repository and at the start of the program, since there is no configured python interpreter I start the configuration by clicking on the button "configure python interpreter"
then select ssh interpreter and enter the ip address of the aws instance and username ubuntu
3) as key I choose a previously saved ppk file
4)continuing with the settings I select the interpreter like the one identified in the path usr/bin/python and as the project directory I select the directory of my project in home/ubuntu/MyProject
this is what i see after setting up the remote interpreter
all connection tests are passed successfully but when I run the code I get this error
Error running 'main': Can't run remote python interpreter: Error connecting to remote host
So how can I solve this problem?
finally I found a solution, by default pycharm set the path for the interpreter usr/bin/python but the correct one is usr/bin/python3, now everything works correctly
I had the same error with a different cause:
One of the docker volume bindings in the Run Configuration pointed to a non-existing host dir

How to run/debug local code using remote interpreter in Pycharm?

I followed below instructions to setup remote interpreter and remote deployment.
https://medium.com/#erikhallstrm/work-remotely-with-pycharm-tensorflow-and-ssh-c60564be862d
It says the below
Deployment
The remote interpreter can not execute a local file, PyCharm have to
copy your source files (your project) to a destination folder on your
remote server, but this will be done automatically and you don’t need
to think about it!
However, I even after setting up automatic deployment in Tools|Deployment|Automatic Upload(always). It is not working as expected and not syncing up files between remote and local automatically in a seamless manner.
Question
So how can I just skip deployment and sync between remote and local folder all together and just run/debug my local code using remote interpreter?
I mean on a local .py file i should be able to but a breakpoint and debug using remote interpreter? This makes life more easier and not worry about sync.

pycharm Error running 'remodel': Can't run remote python interpreter: Can't get remote credentials for deployment server Copy of project-level

I am using pycharm pro(edu email) 2018.3.5x64 version on my own computer. I configure it to run on the server 172.18.49.158:22
while it connect well and the interpret worked well the error occured:
Error running 'remodel': Can't run remote python interpreter: Can't get remote credentials for deployment server Copy of project-level server 'fpn158'
I used it several month and it worked just well, I don't know what happend to it today.
So I reconfigured it. connect successfull, interpreter seems right, upload successfull and the code seems already in the remote anaconda envs(cause no unknown error)
Actually all my pictures are failed to display on my computer, I don't know if you can get them, let me know
----my interpreter for the project
-----my configuration for my project.
---- my successfull upload and error
I delete my configuration about that server,and the interpreter is deleted too. Then I reconfigure them. It went just fine.

Cannot run project deployed on remote server through Pycharm

I deploy a project on a remote ssh server using Pycharm. I have mapped my local folder to the correct path in the remote server and the interpreter used is the one on the server.
When I run my project in Pycharm (deployment actually happens remotely) everything runs smoothly. But if I ssh into the machine and want to start running the project from within the machine, I get
ImportError: No module named 'replay_buffer'
and this applies exclusively to folders within the project (not library dependencies).
How do I fix this?

pycharm remote interpreter with two factor authentication

I would like to use PyCharm with a remote interpreter (in fact using the remote directory structure). The server I am connecting to has two factor authentication which requires a password and time changing code.
How do I setup a login so that PyCharm prompts me for the one time use code?
Will PyCharm use the remote directory structure as I would like or will it keep saving things locally?

Categories

Resources