ModuleNotFoundError: No module named 'lxml' on venv Centos - python

im just trying to run a script to extract some data from a xml using XPATH, so i read i should use lxml or libxml2. The problem is i cant import any of this libraries in any case i get the message "ModuleNotFoundError: No module named" and the name of the module im trying to import.
I am running my script on a virtual environment with Python 2.7.13, i already execute the pip install instruction for both libraries, and i get that message that both of them are already installed.
Thanks for your help.

Related

ModuleNotFound error: cannot find module win32com

I am trying to run a script which will trigger a python file. The python file is using win32com.client. From PyCharm everything is running fine. But when I run script it says no module called win32com. I have installed pypiwin32 and pywin32 already. I have tried out below solutions:
Upgraded pip to new version (21.2.3)
Tried with pip install of pypiwin32
Downloaded file from https://github.com/mhammond/pywin32/releases and I have 64bit(AMD64) on win32
Also tried https://github.com/mhammond/pywin32 and installing via python Scripts/pywin32_postinstall.py -install
Added import os;os.environ["PATH"]+=(';'+os.path.join(sitedir,"pywin32_system32")) in pywin32.pth under the folder--\PythonVersion\Lib\site-packages\
Added environmet variables by creating a PYTHONPATH environment variables, and append the win32 and win32/lib path
Tried with import sys
sys.path.append('\\PythonVersion\\lib\\site-packages\\win32')
sys.path.append('\\PythonVersion\\lib\\site-packages\\win32\\lib')
But still the issue is same and somehow I am not able to resolve. Can anyone please help with this?

No module named 'pandas', 'mysql' despite both of the models are installed

I use VS Code as my main code editor while I'm compiling the code in multiple files it keeps giving me this error for multiple models for example
ModuleNotFoundError: No module named 'pandas'
ModuleNotFoundError: No module named 'mysql'
I reinstall these two packages using pip install pandas and pip install MySQL on my cmd but both of them give me this message requirement already satisfied which mean that both of the two libraries are installed
ps I use python 3.8.1 32-bit as my main interpreter path on VS code
how can I fix this issue?
If you are using virtual environment for your python project in the vscode, then you need to define the path of python(virtual environment) for your workspace.
So in your project, there is .vscode/setting.json where you need to add following.
{
"python.pythonPath": "/path/to/project/project_name/bin/python"
}
After that you can restart your project.

can not import PIL ModuleNotFoundError: No module named 'PIL'

I successfully installed PIL.
But when create new project I can`t import PIL.
Error:
(ModuleNotFoundError: No module named 'PIL')
I am using Python 3.8 and tkinter.
Usually this happens when the python environment you're running is not the same environment that pip is updating. It's pretty common if you have more than one python installation.
Make sure that your OS environment variables for pip and python are directed toward appropriate script files of a particular install.

How to extract molecular properties in Avogadro software

I'm working on a python program that can extract molecular properties from Avogadro. But the module 'Avogadro' is not working and gives an error massage ModuleNotFoundError: No module named 'avogadro'. How can I over come this problem?
There is a problem because in Pypi you can see it says that pip install Avogadro will install the module. But it do not install the module.

Installed python-docx package yet get the ImportError: No module named docx

I installed the python-docx package and have verified that it exist using the pip command Freeze. When I use that command it shows docx==0.2.0 but when I try to import it in my script I get a ImportError: No module named docx, any ideas whats going on.
Try setting your PYTHONPATH environment variable.
http://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH
If you need to find where pip is, you could try the locate command if you're on Linux.
http://www.computerhope.com/unix/ulocate.htm
http://linux.die.net/man/1/locate

Categories