Pycharm Can't run remote python interpreter error - python

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

Related

Cannot runserver from Pycharm using Vagrant Interpreter. Path for manage.py is wrong, don't know where to fix it

I'm trying to configure correctly Pycharm (for a Django project) + Vagrant, to launch the runserver remotely from my host machine (and thus enable debugging).
The command for such seems simple but the path is wrong, so it fails.
It tries to run
/home/vagrant/.virtualenvs/[myprojname]/bin/python /vagrant/[myprojname]/manage.py runserver 0.0.0.0:8000
Second parameter is wrong, it's missing either the initial /home/ or it isn' a relative path.
My run configuration
I'm running a host windows machine, and a vagrant ubuntu 20.10 guest VB.
I setup my remote interpreter with what I suppose are the right parameters.
In my vagrantfile I have setup the shared folder as following (Project name is PoeMogul)
config.vm.synced_folder "PoeMogul", "/home/vagrant/PoeMogul"
In my vagrant box, everything is setup fine (I think). I have my venv. In my /home/vagrant/PoeMogul dir i can see my working directory from PyCharm. I can manually (through vagrant ssh) run the server. But i cannot make Pycharm invoke the manage.py file correctly, it tries to access "/vagrant/..." and not "/home/vagrant/...".
To resolve the issue with the incorrect path in PyCharm, you should specify the correct path to the Python interpreter and the Django project in the Run Configuration.
In PyCharm, go to Run > Edit Configurations.
Click the plus sign (+) to create a new configuration, and select Django Server.
Give the configuration a name, such as "Vagrant Django Server".
In the Environment section, select the remote interpreter that you set up for your Vagrant virtual machine.
In the Host field, enter the IP address of the Vagrant machine, 0.0.0.0.
In the Port field, enter 8000.
In the Working directory field, enter the absolute path to your Django project in the Vagrant virtual machine, e.g. /home/vagrant/PoeMogul.
In the manage.py script field, enter the absolute path to the manage.py file in the Django project, e.g. /home/vagrant/PoeMogul/manage.py.
Click Apply and then OK to save the changes.
Now, when you run the Vagrant Django Server configuration in PyCharm, it should use the correct paths and start the Django development server on your Vagrant virtual machine, accessible at 0.0.0.0:8000 from your host machine.

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?

Log error about Python remote development with PyCharm

I want to finish the Python remote development with Pycharm followed by this instruction:https://blog.jetbrains.com/pycharm/2015/03/feature-spotlight-python-remote-development-with-pycharm/. Please check it by this image.
I want my current local project directory blueprintexampe to be mapped to remote /home/vagrant/blueprintremote. Now I can right-click my project in the project view and select Upload to. But there is log error is shown as following:
Upload to 192.168.33.10 failed: SSH_MSG_DISCONNECT: 2 Too many
authentication failures for vagrant
Do you know how to solve it?

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

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.

Categories

Resources