import matplotlib failed in Anaconda python3.6 - python

I installed Anaconda to simplify the management of many python modules.
After that i tried to "import subprocess":
>>> import subprocess
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sej/.config/anaconda3/lib/python3.6/subprocess.py", line 155, in <module>
_PopenSelector = selectors.SelectSelector
AttributeError: module 'selectors' has no attribute 'SelectSelector'
How to fix this?
I came accross this problem by trying to use matplotlib.
When trying to import it, this error comes up:
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sej/.config/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py", line 127, in <module>
from matplotlib.compat import subprocess
File "/home/sej/.config/anaconda3/lib/python3.6/site-packages/matplotlib/compat/subprocess.py", line 27, in <module>
import subprocess
File "/home/sej/.config/anaconda3/lib/python3.6/subprocess.py", line 155, in <module>
_PopenSelector = selectors.SelectSelector
AttributeError: module 'selectors' has no attribute 'SelectSelector'

Related

How do I fix this error I get when I import keras into python?

I am trying to import keras into python and keep getting this error. I have checked all of the installs and can not figure out what is going on
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\__init__.py", line 20, in <module>
from . import initializers
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\initializers\__init__.py", line 124, in <module>
populate_deserializable_objects()
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\initializers\__init__.py", line 82, in populate_deserializable_objects
generic_utils.populate_dict_with_module_objects(
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

sklearn.utils module is not found

So I have sklearn installed, but for some reason whenever I try to import sklearn it says:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\joeya\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\__init__.py", line 82, in <module>
from .base import clone
File "C:\Users\joeya\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\base.py", line 17, in <module>
from .utils import _IS_32BIT
ModuleNotFoundError: No module named 'sklearn.utils'
Does anyone have any ideas? I have Python 3.8.7 installed.

how to correct AttributeError

i have imported ncurses but it shows me this error
Traceback (most recent call last):
File "C:\Users\jai.best-PC\Desktop\the real snk game.py", line 1, in <module>
import ncurses
File "C:\Python27\lib\ncurses.py", line 8, in <module>
import _curses
File "C:\Python27\lib\_curses\__init__.py", line 59, in <module>
import has_key
File "C:\Python27\lib\_curses\has_key.py", line 11, in <module>
_curses.KEY_A1: 'ka1',
AttributeError: 'module' object has no attribute 'KEY_A1'
why i get an Attribute Error here while
import _curses
_capability_names = {
_curses.KEY_A1: 'ka1',
i have it here in has_key.py module
Since you are on windows, python curses isn't provided inbuilt.
Try:
pip install windows-curses

Pyculib ImportError: cannot import name config

when trying to import pyculib I get ImportError: cannot import name config
I have tried pip installing and conda installing various versions of the cudatoolkit but none seem to work.
import pyculib
I get this error the first time I try to import pyculib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/__init__.py", line 49, in <module>
from . import blas, sparse, fft, rand, sorting
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/__init__.py", line 1, in <module>
from .radixsort import RadixSort
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/radixsort.py", line 38, in <module>
lib = load_lib('radixsort')
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/common.py", line 24, in load_lib
libpath = os.path.join(findlib.get_lib_dir(), fullname)
AttributeError: 'module' object has no attribute 'get_lib_dir'
and this error if I try a second time
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named config

Could someone explain this Python import error? Anaconda 3.5

from rpy2.robjects import pandas2ri, r
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wayne/anaconda3/lib/python3.5/site-packages/rpy2/robjects/__init__.py", line 16, in <module>
import rpy2.rinterface as rinterface
File "/home/wayne/anaconda3/lib/python3.5/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: libiconv.so.2: cannot open shared object file: No such file or director

Categories

Resources