connecting to console

Hello, Im new to python/pycharm, and I have faced the following problem.

My python projects worked perfectly, but when I have opened pycharm and tried to run code today, it printed this:

"A:\python proj\venv\Scripts\python.exe" "C:\Program Files\JetBrains\PyCharm 2019.3.4\plugins\python\helpers\pydev\" --mode=client --port=52929

Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2019.3.4\plugins\python\helpers\pydev\", line 6, in <module>
from _pydev_imps._pydev_saved_modules import thread
File "C:\Program Files\JetBrains\PyCharm 2019.3.4\plugins\python\helpers\pydev\_pydev_imps\", line 21, in <module>
import xmlrpc.client as xmlrpclib
File "C:\Users\nokol\AppData\Local\Programs\Python\Python37\lib\xmlrpc\", line 135, in <module>
from decimal import Decimal
File "C:\Users\nokol\AppData\Local\Programs\Python\Python37\lib\", line 3, in <module>
from _decimal import *
File "A:\python proj\", line 1, in <module>
import numpy
File "A:\python proj\venv\lib\site-packages\numpy\", line 142, in <module>
from . import core
File "A:\python proj\venv\lib\site-packages\numpy\core\", line 76, in <module>
from . import numerictypes as nt
File "A:\python proj\venv\lib\site-packages\numpy\core\", line 599, in <module>
File "A:\python proj\venv\lib\site-packages\numpy\core\", line 594, in _register_types
AttributeError: module 'numbers' has no attribute 'Integral'


and also it has stuck on "connecting to console" 

I was searching for the solution and found several simmilar questions, but non of it had helped me. Maybe I did something wrong. So I will be glad if you help me

Comment actions Permalink

Please make sure that you are able to run this script with your project interpreter without error in the system CLI.

Try the usual run instead of running in the Python Console and let me know if it works.

Comment actions Permalink

I can run this script in 3.8 IDLE without any problems but the other ways of running aren't working. Yesterday I have tired different ways of solving this problem.

First of all I have got 2 types of python shells: 3.7.7 and 3.8.2. Pycharm used the first one, but when I tried to run some simple script in IDLE, it worked only in 3.8.2 unlike the 3.7.7.

So I decided to delete the old version and reinstal Pycharm. Nothing has been changed after this. But then I created a new project in Pycharm, he asked me to install numpy, etc again. So I had restarted my computer, copied old versions of my scripts and run them in my new project. In this case all of them worked pretty well, without any "connecting to console" thing. 

But then I decided to run this script 

import numpy
import matplotlib.pyplot

data_file = open("A:\нейронки\MNIST\c сайта\mnist_test.csv", 'r')
data_list = data_file.readlines()

all_values = data_list[0].split(',')

image_array = numpy.asfarray(all_values[1:]).reshape((28, 28))

matplotlib.pyplot.imshow(image_array, cmap='green', interpolation='none')

It worked good until the

image_array = numpy.asfarray(all_values[1:]).reshape((28, 28))

The error is

C:\Users\nokol\AppData\Local\Programs\Python\Python38\python.exe "A:/new stab/"
Traceback (most recent call last):
File "A:/new stab/", line 1, in <module>
import numpy
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\", line 142, in <module>
from . import core
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\", line 24, in <module>
from . import multiarray
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\", line 14, in <module>
from . import overrides
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\", line 16, in <module>
RuntimeError: implement_array_function method already has a docstring

Process finished with exit code 1


From that moment I couldn't ran my previous script without this error. And The other one has "connecting to console" problem. (I can run it only in IDLE).



Comment actions Permalink

If you run the following command from the command line, does it give you the same error?

C:\Users\nokol\AppData\Local\Programs\Python\Python38\python.exe "A:/new stab/"

Comment actions Permalink

It print this:

A:\new stab>C:\Users\nokol\AppData\Local\Programs\Python\Python38\python.exe "A:/new stab/
Traceback (most recent call last):
File "A:/new stab/", line 1, in <module>
import numpy
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\", line 142, in <module>
from . import core
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\", line 76, in <module>
from . import numerictypes as nt
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\", line 86, in <module>
import numbers
File "A:\new stab\", line 2, in <module>
import matplotlib.pyplot
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 1015, in <module>
rcParams = rc_params()
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 878, in rc_params
return rc_params_from_file(matplotlib_fname(), fail_on_error)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 991, in rc_params_from_file
config = RcParams([(key, default) for key, (default, _) in iter_params
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 782, in __init__
self.update(*args, **kwargs)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\", line 838, in update
self[key] = value
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 806, in __setitem__
cval = self.validate[key](val)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 341, in validate_color
if is_color_like(s):
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 134, in is_color_like
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 185, in to_rgba
rgba = _to_rgba_no_colorcycle(c, alpha)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\", line 200, in _to_rgba_no_colorcycle
if c is
AttributeError: partially initialized module 'numpy' has no attribute 'ma' (most likely due to a circular import)


Please sign in to leave a comment.