10

when I run my python file it's nothing except express "connecting to console" like this

enter image description here

what's wrong?

Nipun Thennakoon
  • 3,586
  • 1
  • 18
  • 26
bgx
  • 131
  • 1
  • 1
  • 5
  • Did you set up a Python interpreter for the console in `File > Settings > Build, Execution, Deployment > Console > Python Console`? If yes, we will need more info about what do you mean by "run my python file" and how you are trying to run it in order to be able to help you. – Eskapp Dec 28 '18 at 15:26
  • firstly,thank you for your answer,I use the newest pycharm and anaconda , and when I run my python file(run the python code) ,there is no answer,just show connecting to console,and I want know if the version problems? – bgx Dec 29 '18 at 05:30
  • The version is not the problem, I use the exact same. It looks like a configuration issue. – Eskapp Dec 29 '18 at 14:29
  • Thanks your ,I have already solved my problems, as what you say , it exactly is the configuration issue – bgx Dec 30 '18 at 11:41
  • Could you write an answer to your own question explaining how you solved the issue for any future reader that runs into the same problem? – Eskapp Jan 02 '19 at 18:27
  • Fine , I have put it on – bgx Jan 03 '19 at 12:10
  • A similar issue was fixed with PyCharm 2019.3 and Python 3.8, see https://stackoverflow.com/questions/59371627/pycharm-does-not-connect-to-console-with-python3-8?rq=1 – questionto42 Jun 28 '20 at 11:58
  • make sure that content of _compat.py file is identical to https://github.com/JetBrains/intellij-community/commit/07ef928f3b1fbc24401380110691342a558de242 – Alex Zubkov Sep 26 '21 at 01:25

2 Answers2

3

I solved my issue and here is how I did it . I create an new environment in anaconda with python 3.6 and then use pip to install the package I want, meanwhile when we import our new environment, we should check inherit global site-packages.Then we can use Pycharm as we want.

bgx
  • 131
  • 1
  • 1
  • 5
  • 1
    Could you please improve the answer - quite hard to follow with the limited information – MattiH May 01 '21 at 20:50
  • Yeah, this doesn't work for me. I have a valid python virtualenv set just like in all other projects. The other projects do not have this symptom and one project does. Global site packages have nothing to do with it. I even removed the python console and this thing now says "Stopping - connecting to console" forever. – Samantha Atkins Feb 09 '22 at 01:22
1
  1. Press CTRL + ALT + S to open your setting.
  2. Go to your Project: -> Project Interpreter -> The Gear on top right
  3. Choose the Conda Environment
  4. Follow this link: https://docs.anaconda.com/anaconda/user-guide/tasks/pycharm/
Azriel Tan
  • 61
  • 1
  • 5