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
Related
I just have installed wxPython and python toolkit 18.08 in Ubuntu 20.04.But,while runnimg from command line python PTK.pyw, I got an error as below
> Traceback (most recent call last):
File "PTK.pyw", line 10, in <module>
import ptk_lib.app as app
File "/home/jobayer/下载/PythonToolkit-18.08/ptk_lib/app.py", line 17, in <module>
from ptk_lib.message_bus.mb_node import MBLocalNode
File "/home/jobayer/下载/PythonToolkit-18.08/ptk_lib/message_bus/mb_node.py", line 14, in <module>
import mb_protocol
ModuleNotFoundError: No module named 'mb_protocol'
I did not find mb_protocol module any where.Where can I find this module?
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
I was trying to run a python tool called "read_fast5_basecaller.py". It throws an error which is "AttributeError: module 'h5py.tests.old' has no attribute 'MODULES'"
read_fast5_basecaller.py
Traceback (most recent call last):
File "/home/kokep/bin/bin/read_fast5_basecaller.py", line 73, in <module>
from albacore.fast5_fastq_data_handler import Fast5FastQDataHandler
File "/home/kokep/bin/lib/python3.6/site-packages/albacore/fast5_fastq_data_handler.py", line 14, in <module>
from albacore.fast5_data_handler import Fast5DataHandler
File "/home/kokep/bin/lib/python3.6/site-packages/albacore/fast5_data_handler.py", line 15, in <module>
from albacore.read_metadata import ReadMetadata
File "/home/kokep/bin/lib/python3.6/site-packages/albacore/read_metadata.py", line 5, in <module>
from ont_fast5_api.fast5_file import Fast5File
File "/home/kokep/bin/lib/python3.6/site-packages/ont_fast5_api/fast5_file.py", line 5, in <module>
import h5py
File "/home/kokep/bin/lib/python3.6/site-packages/h5py/__init__.py", line 62, in <module>
from .tests import run_tests
File "/home/kokep/bin/lib/python3.6/site-packages/h5py/tests/__init__.py", line 17, in <module>
MODULES = old.MODULES + hl.MODULES
AttributeError: module 'h5py.tests.old' has no attribute 'MODULES'
I was wondering if old module of h5py is needed. Should I install the older version of the h5py module? Thank you.
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'
Traceback (most recent call last):
File "F:/fzy/python/corepython/tensorflow-test.py", line 1, in <module>
import tensorflow as tf
File "E:\anacoda\Lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "E:\anacoda\Lib\site-packages\tensorflow\python\__init__.py", line 30, in <module>
import traceback
File "E:\anacoda\lib\traceback.py", line 5, in <module>
import linecache
File "E:\anacoda\lib\linecache.py", line 11, in <module>
import tokenize
File "E:\anacoda\lib\tokenize.py", line 33, in <module>
import re
File "E:\anacoda\lib\re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
I install tensorflow and found this error,but I didn't know how conda cause it.
As a guess, one of the following things happened:
pip install enum -- a different enum package than the stdlib version which is shadowing the stdlib version
enum.py file -- you have created an enum.py file which is shadowing the stdlib version
you have somehow deleted the enum.py that comes with the stdlib