AttributeError: module 'h5py.tests.old' has no attribute 'MODULES' - python

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.

Related

AttributeError: module 'numpy.random' has no attribute 'mtrand'

After having installed the pyclustertend package with pip install pyclustertend, I now try to import it into Python:
from pyclustertent import ivat
However, I get the following error while doing so:
Traceback (most recent call last):
File "", line 1, in
from pyclustertend import ivat
File "C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\pyclustertend_init_.py", line 1, in
from .hopkins import hopkins # noqa: F401
File "C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\pyclustertend\hopkins.py", line 5, in <module>
from sklearn.neighbors import BallTree
File "C:\Users\Emil\Anaconda3\lib\site-packages\sklearn\__init__.py", line 82, in <module>
from .base import clone
File "C:\Users\Emil\Anaconda3\lib\site-packages\sklearn\base.py", line 17, in <module>
from .utils import _IS_32BIT
File "C:\Users\Emil\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 29, in <module>
from .fixes import parse_version, threadpool_info
File "C:\Users\Emil\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 47, in <module>
class loguniform(scipy.stats.reciprocal):
File "C:\Users\Emil\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 1601, in __init__
super(rv_continuous, self).__init__(seed)
File "C:\Users\Emil\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 588, in __init__
self._random_state = check_random_state(seed)
File "C:\Users\Emil\Anaconda3\lib\site-packages\scipy\_lib\_util.py", line 202, in check_random_state
return np.random.mtrand._rand
AttributeError: module 'numpy.random' has no attribute 'mtrand'
I suspected this has to do with the Numpy version. However, during the installation, it updated numpy to an older version:
Successfully uninstalled numpy-1.23.4
Successfully installed numpy-1.20.3 pyclustertend-1.8.2
What do I need to do to use this package?

ModuleNotFoundError: No module named 'winreg'

I have been trying to use photoshop-python-api but I keep getting this error.
Traceback (most recent call last):
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/api.py", line 2, in <module>
import photoshop.api as ps
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/venv/lib/python3.8/site-packages/photoshop/__init__.py", line 1, in <module>
from photoshop.session import Session
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/venv/lib/python3.8/site-packages/photoshop/session.py", line 31, in <module>
from photoshop.api import (
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/venv/lib/python3.8/site-packages/photoshop/api/__init__.py", line 4, in <module>
from .action_descriptor import ActionDescriptor
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/venv/lib/python3.8/site-packages/photoshop/api/action_descriptor.py", line 12, in <module>
from ._core import Photoshop
File "/Users/yash.sinha/PycharmProjects/PhotoshopPythonAPI/venv/lib/python3.8/site-packages/photoshop/api/_core.py", line 6, in <module>
import winreg
ModuleNotFoundError: No module named 'winreg'
I did my research on winreg and I found out that it is a Windows Register. Am I getting this error because I am using a Mac? I have python 3.8.2 on my system.
Help.

import spacy results in error: ModuleNotFoundError: No module named 'email.parser'; 'email is not a package [duplicate]

This question already has answers here:
Importing installed package from script with the same name raises "AttributeError: module has no attribute" or an ImportError or NameError
(2 answers)
Closed 4 years ago.
I'm on Windows 10 and used pip to install spacy but am now getting an error when running
import spacy
in python shell.
My error message is:
Traceback (most recent call last):
File "C:\Users\Administrator\errbot-root\plugins\utility\model_training_test.py", line 17, in <module>
import spacy
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\spacy\cli\download.py", line 5, in <module>
import requests
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\__init__.py", line 43, in <module>
import urllib3
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 11, in <module>
from .exceptions import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 203, in load_module
mod = mod._resolve()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
__import__(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 71, in <module>
import email.parser
File "C:\Users\Administrator\errbot-root\plugins\utility\email.py", line 1, in <module>
from errbot import BotPlugin, botcmd, arg_botcmd, webhook
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\errbot\__init__.py", line 12, in <module>
from .core_plugins.wsview import bottle_app, WebView
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\errbot\core_plugins\wsview.py", line 5, in <module>
from bottle import Bottle, request
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\bottle.py", line 38, in <module>
import base64, cgi, email.utils, functools, hmac, imp, itertools, mimetypes,\
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\cgi.py", line 39, in <module>
from email.parser import FeedParser
ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package
Edit: When trying to pip install email, i get the following error:
Collecting email
Using cached https://files.pythonhosted.org/packages/71/e7/816030d3b0426c130040bd068be62b9213357ed02896f5d9badcf46d1b5
f/email-4.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\setuptools\__init__.py", lin
e 12, in <module>
import setuptools.version
File "c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\setuptools\version.py", line
1, in <module>
import pkg_resources
File
"c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py",
line 36, in <module>
import email.parser
File "C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-install-
p378w8he\email\email\parser.py", line 10, in <module>
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-install-p378w8
he\email\
SpaCy had been installed properly, there was simply another file named email.py that was interfering with the standard library email. Don't name your files after standard libraries.

AttributeError: 'module' object has no attribute 'tokenize'

I have nltk installed in my virtualenv. When I do pip freeze , among other packages I can see nltk==3.2.1.
I am using Ubuntu 14.04 and python 2.7. And After activating virtualenv, when I try to import nltk from python shell, I get following error.
>>> import nltk
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/nltk/__init__.py", line 128, in <module>
from nltk.chunk import * File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/nltk/chunk/__init__.py", line 157, in <module>
from nltk.chunk.api import ChunkParserI File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/nltk/chunk/api.py", line 13, in <module>
from nltk.parse import ParserI File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/nltk/parse/__init__.py", line 79, in <module>
from nltk.parse.transitionparser import TransitionParser File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/nltk/parse/transitionparser.py", line 21, in <module>
from sklearn.datasets import load_svmlight_file File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/base.py", line 11, in <module>
from .utils.fixes import signature File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 17, in <module>
from ..externals.joblib import cpu_count File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/externals/joblib/__init__.py", line 127, in <module>
from .parallel import Parallel File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/externals/joblib/parallel.py", line 30, in <module>
from .format_stack import format_exc, format_outer_frames File "/home/kenden/den/codes/myenv/lib/python2.7/site-packages/sklearn/externals/joblib/format_stack.py", line 35, in <module>
generate_tokens = tokenize.tokenize AttributeError: 'module' object has no attribute 'tokenize'
How can I solve this problem?

attribute error on numpy import with python 2.7 and wxpython

I am struggling to get an ide working for python 2.7 with numpy, scipy, matplotlib and wxpython/PyQt installed. Running the ide spyder throws up the message "module 'object' has no attribute 'core'" for numpy. Same message occurs while "from numpy import *" on IDLE.
Here is the whole message. Please help. Thanks!
C:\Python27\Scripts>C:\Python27\python.exe "C:\Python27\Scripts\spyder"
Traceback (most recent call last):
File "C:\Python27\Scripts\spyder", line 2, in <module>
from spyderlib import spyder
File "C:\Python27\lib\site-packages\spyderlib\spyder.py", line 96, in <module>
from spyderlib.utils.environ import WinUserEnvDialog
File "C:\Python27\lib\site-packages\spyderlib\utils\environ.py", line 17, in <module>
from spyderlib.widgets.dicteditor import DictEditor
File "C:\Python27\lib\site-packages\spyderlib\widgets\dicteditor.py", line 31, in <module>
from spyderlib.config import get_icon, get_font
File "C:\Python27\lib\site-packages\spyderlib\config.py", line 27, in <module>
from spyderlib.utils import iofuncs, codeanalysis
File "C:\Python27\lib\site-packages\spyderlib\utils\iofuncs.py", line 61, in <module>
import numpy as np
File "C:\Users\User\AppData\Roaming\Python\Python27\site-packages\numpy\__init__.py", line 137, in <module>
import add_newdocs
File "C:\Users\User\AppData\Roaming\Python\Python27\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Users\User\AppData\Roaming\Python\Python27\site-packages\numpy\lib\__init__.py", line 13, in <module>
from polynomial import *
File "C:\Users\User\AppData\Roaming\Python\Python27\site-packages\numpy\lib\polynomial.py", line 11, in <module>
import numpy.core.numeric as NX
AttributeError: 'module' object has no attribute 'core'

Categories

Resources