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\pydevconsole.py" --mode=client --port=52929

Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2019.3.4\plugins\python\helpers\pydev\pydevconsole.py", 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\_pydev_saved_modules.py", line 21, in <module>
import xmlrpc.client as xmlrpclib
File "C:\Users\nokol\AppData\Local\Programs\Python\Python37\lib\xmlrpc\client.py", line 135, in <module>
from decimal import Decimal
File "C:\Users\nokol\AppData\Local\Programs\Python\Python37\lib\decimal.py", line 3, in <module>
from _decimal import *
File "A:\python proj\numbers.py", line 1, in <module>
import numpy
File "A:\python proj\venv\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "A:\python proj\venv\lib\site-packages\numpy\core\__init__.py", line 76, in <module>
from . import numerictypes as nt
File "A:\python proj\venv\lib\site-packages\numpy\core\numerictypes.py", line 599, in <module>
_register_types()
File "A:\python proj\venv\lib\site-packages\numpy\core\numerictypes.py", line 594, in _register_types
numbers.Integral.register(integer)
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

4 comments
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.

0
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()
data_file.close()
print(len(data_list))
print(data_list[0])

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')
matplotlib.pyplot.show()

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/numbers.py"
Traceback (most recent call last):
File "A:/new stab/numbers.py", line 1, in <module>
import numpy
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\overrides.py", line 16, in <module>
add_docstring(
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).

 

 

0
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/numbers.py"

0
Comment actions Permalink

It print this:

A:\new stab>C:\Users\nokol\AppData\Local\Programs\Python\Python38\python.exe "A:/new stab/numbers.py
Traceback (most recent call last):
File "A:/new stab/numbers.py", line 1, in <module>
import numpy
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\__init__.py", line 76, in <module>
from . import numerictypes as nt
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\numerictypes.py", line 86, in <module>
import numbers
File "A:\new stab\numbers.py", line 2, in <module>
import matplotlib.pyplot
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\__init__.py", line 1015, in <module>
rcParams = rc_params()
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\__init__.py", 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\__init__.py", 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\__init__.py", line 782, in __init__
self.update(*args, **kwargs)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\_collections_abc.py", line 838, in update
self[key] = value
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\__init__.py", line 806, in __setitem__
cval = self.validate[key](val)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\rcsetup.py", line 341, in validate_color
if is_color_like(s):
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\colors.py", line 134, in is_color_like
to_rgba(c)
File "C:\Users\nokol\AppData\Local\Programs\Python\Python38\lib\site-packages\matplotlib\colors.py", 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\colors.py", line 200, in _to_rgba_no_colorcycle
if c is np.ma.masked:
AttributeError: partially initialized module 'numpy' has no attribute 'ma' (most likely due to a circular import)

0

Please sign in to leave a comment.