I have the following versions of mxnet==1.4.0 and gluonnlp==0.9.1 installed using pip.
However when I run the following codeimport gluonnlp as nlp it yields the following error
ModuleNotFoundError: No module named 'mxnet.contrib.amp'
So I try to manually import the missing module using
from mxnet.contrib import amp
import gluonnlp as nlp
which also yields an error
ImportError: cannot import name 'amp' from 'mxnet.contrib' (/usr/local/lib/python3.7/dist-packages/mxnet/contrib/__init__.py)
I've been running the code on Colab. Is there a possible workaround for this issue?
Please Advise.
I have not used these libraries but in this github issue they say:
AMP was introduced in MXNet 1.5. Could you try that version (or newer)?
So I think that the problem is there.
Cheers!
Related
After installing azure servicebus from pypl( azure-servicebus 7.3.4 ) using pip, i am trying those provided sample code from https://pypi.org/project/azure-servicebus/.
It gives error:
from azure.servicebus import ServiceBusClient
ImportError: cannot import name 'ServiceBusClient' from partially initialized module 'azure.servicebus' (most likely due to a circular import) (C:\python\lib\site-packages\azure\servicebus_init_.py)
I am using windows10.
other azure services like FaceAPI and CustomVision libraries are working fine.
Just this ServiceBus is throwing error.
I am new to azure in python. Any kind help of help is highly appreciable.
Make sure you don’t have any of your working .py file named like ServiceBusClient.py or ServiceBusMessage.py or azure_servicebus.py which can conflict with Python/ServiceBus package installed files.
If you are using Python 3.8.9, you can try installing the lower version of azure-servicbus as answered by Frank Gong
pip install azure-servicebus==7.0.0
You can refer to ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import), Circular Import Error while importing create_engine in Sqlalchemy, and ImportError: cannot import name 'ServiceBusClient' from 'azure.servicebus'
You can refer to the available Azure Service Bus libraries for Python
I was going through an Reinforcement Learning Course and wanted to try running the code locally. I installed RLGlue with pip install rlglue from here
But then when trying to run the code:
from rlglue.rl_glue import RLGlue
import main_agent
import ten_arm_env
import test_env
Received this error message:
ModuleNotFoundError: No module named 'rlglue.rl_glue'
Any idea on how to fix that to import the module?
I use this as work-around, add this file to your project.
https://gist.github.com/niektuytel/eab1117070454042b11e5e5c026dd3fb
I am installing the package for data-cleaning purpose,
!pip install tweet-preprocessor
from preprocessor import TwitterPreprocessor
I am using both Jupyter and Colab, there is no issue using in Jupyter. But still, receiving this issue in colab:
ImportError: cannot import name 'TwitterPreprocessor' from 'preprocessor' (/usr/local/lib/python3.7/dist-packages/preprocessor/init.py)
Please help me with this problem to correct.
Thank you
The library tweet-preprocessor simply doesn't have the TwitterPreprocessor you're trying to import. Take a look at the GitHub repo - no TwitterPreprocessor in sight.
It's suggested to import it via: import preprocessor as p (or import one of the said names from the GitHub repo). You can look at the __init__.py what names you're able to import.
ImportError: cannot import name 'TwitterPreprocessor' from 'preprocessor' ([...]\preprocessor\_init_.py)
In Google colab I am to trying import BucketIterator using:
from allennlp.data.iterators import BucketIterator
But it is raising the same error again and again-
ModuleNotFoundError: No module named 'allennlp.data.iterators
After installing allennlp with the imports:
from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer
from allennlp.data.tokenizers.character_tokenizer import CharacterTokenizer
from allennlp.data.vocabulary import Vocabulary
from allennlp.modules.seq2vec_encoders import PytorchSeq2VecWrapper
are working fine. Is there a way to solve this issue?
I was facing the same issue.
It won't work, since Iterators are removed from allennlp.
Install a legacy version of allennlp. allennlp is depended upon the PyTorch(torchtext) library. And since torchtext removed iterators form their newer versions allennlp did it too.
You can directly use torchtext.data.BucketIterator(). Use:
pip install torchtext==0.5.0 --user
I have this library in my code:
from pyrouge.utils import log
But I am getting the following error:
ModuleNotFoundError: No module named 'pyrouge.utils';
'pyrouge' is not a package
Though pyrouge in already installed in my system. I tried to find its solution but there are like none results. Can anyone help me here?