Python Console not connecting
I have set up a new project in Python and configured a venv based on installed Python 3.6 on my PC. however the python console continually gives this error when I try to run code:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
However if I go to the terminal and open python there it works fine.
I am currently running PyCharm 2020.1 as my IT dept have so far ignored my requests to allow PyCharm to update and I am not an administrator so I cannot update the software!!
Please sign in to leave a comment.
Hello,
The error looks like AV, FW restriction. Do you have any? Please try disabling it.
Ah yes that's probably it. Unfortunately this PC is managed by our IT department and I'm not sure if they will be willing to let it through. I asked before, but as it is impacting my work, hopefully they will!
I have admin right (and try to use it) and in cmd also connection work fine, and error only inside PyCharm
also I try to disable firewall - this not helps.
@... Firewalls can block network traffic for specific processes. So if PyCharm process is blocked, so is any python process it spawns. Please try disabling any firewall software you may have.
I disable firewall - this not helps.
also i try run simple testing file
and this works correct, but when i try to run this with submodule i get error
Well, the issue is specifically when you connect to localhost on port 8707. Try this:
Open terminal in PyCharm and do:
If you don't have telnet, you can use:
Then do the same test from system terminal (outside of IDE). Share the results.
telnet localhost 8707 Connecting To localhost...Could not open connection to the host, on port 8707: Connect failed
ComputerName : localhost
RemoteAddress : ::1
RemotePort : 8707
InterfaceAlias : Loopback Pseudo-Interface 1
SourceAddress : ::1
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
so, what I'll do next?
It means this is a network issue external to PyCharm. If you're in corporate network, please ask your system administrator to take a look. Otherwise the issue should be solved on a system level.
yes, it was not a PyCharm problem, its because I recently add server link for shell script for run venv, but don't append environment variable for PyCharm, so its was the reason why PyCharm try to find sever as localhost