ModuleNotFoundError: No module named 'xmltodict' - python-3.x

I have installed xmltodict successfully using the below command
python -m pip install --upgrade --user xmltodict
But when I am executing a python script which contains import xmltodict I am getting the below error
import xmltodict
ModuleNotFoundError: No module named 'xmltodict'
Can some please help me to fix this?

I encountered the same problem in pip 18.1. try to upgrade the pip first, uninstall and reinstall the xmltodict module.

Related

ImportError: cannot import name 'Ontonotes' from 'allennlp.data.dataset_readers.dataset_utils'

I'm using python 3.7 and pytorch in google colab.
I installed
Pip install alennlp==2.4.0
pip install allennlp-models
In google colab, but when I run this code:
allennlp train experiments/oie_labeler_crf.json -s ~/Desktop/PHD/NLP/large-scale-oie/results/classic_train_crf --include-package large_scale_oie
I get this error:
File "/content/large-scale-oie/large_scale_oie/dataset_readers/oie_reader.py", line 12, in
from allennlp.data.dataset_readers.dataset_utils import Ontonotes, OntonotesSentence
ImportError: cannot import name 'Ontonotes' from 'allennlp.data.dataset_readers.dataset_utils' (/usr/local/lib/python3.7/dist-packages/allennlp/data/dataset_readers/dataset_utils/init.py)
Please help me! What do I do?
You might be using an incompatible AllenNLP version. You can try to run:
pip install alennlp==0.9.0
I believe the error will be gone.

pyttsx3.init() give an error in python 3.9

I tried below code:
>>> import pyttsx3
>>> engine = pyttsx3.init()
>>> engine.say('hello')
>>> engine.runAndWait()
But it give me an error as below:
import pywintypes
ModuleNotFoundError: No module named 'pywintypes'
I already tried this to solve:
pip install pypiwin32
python -m pip install pywin32
pip install -U pypiwin32
python -m pip install pyttsx3==2.71
But not any one work for me.
I'm using win10
can anyone help me?
If you want to use pyttsx3 in python 3 you have to use pip3 not pip to install the packages. It won't work with pip. pip works for python2 only.
Try the following:
pip3 install pywin32 pypiwin32 pyttsx3
This should work

import error when trying to import tensorflow in python3

I'm getting this error when trying to import tensorflow ImportError: cannot import name 'tensorflow' from 'opt_einsum.backends' (/usr/local/lib/python3.7/site-packages/opt_einsum/backends/__init__.py).
I've installed it using pip and it's version 2.2.0.
Can someone please help me with this?
I had the same error, removing and reinstalling opt_einsum worked for me, e.g.:
pip uninstall opt_einsum
pip install opt_einsum
If this doesn't work, check if tensorflow.py is located in the /usr/local/lib/python3.7/site-packages/opt_einsum/backends/
folder

Python ModuleNotFoundError: No module named 'win32event'

in my Python Script there is an ERROR with the line
import win32events
I still installed the package pypiwin32 (with pip install pypiwin32) but it seems that this is nor the right package.
Does someone know what I need to install to use win32events in Python?
You should install pywin32 package (not pypiwin32)!!!

ImportError: No module named 'image'

I am working on a faceRecognizer code written with python 3. I am getting this error :
import image ImportError: No module named 'image'
how can I import this module ?
Install: pip install pillow More details from here.
and Try this: from PIL import Image
Try this
>>> import Image
>>>
Make sure you have installed the dependencies by doing a
$ sudo apt-get install tesseract && pip install pytesseract

Resources