No module named 'clean-text' after installing it with Conda - python

I am trying to use the clean-text package.
For installation I used conda install -n nlp -c conda-forge clean-text, where nlp is my virtual environment name. When I run from cleantext import clean using nlp environment, I get:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
C:\Users\SZXFL9~1\AppData\Local\Temp/ipykernel_16796/1988090573.py in <module>
----> 1 from cleantext import clean
ModuleNotFoundError: No module named 'cleantext'
Other imports like pandas etc. work using this virtual environment, but I installed them via the conda GUI. However, also clean-text is displayed in the GUI, so it must be installed.
How can that problem be solved?

Related

ModuleNotFoundError: No module named 'tableau_api_lib'

I have installed the library using command pip install --upgrade tableau-api-lib
It is also installed on my system
Package Version
------------------ ---------
tableau-api-lib 0.1.45
python --version
Python 3.10.6
But when I am running in on Jupyter, I am getting error that
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_5860/1301965758.py in <module>
1 import io
----> 2 from tableau_api_lib import TableauServerConnection
3 from tableau_api_lib.utils.querying import get_views_dataframe, get_view_data_dataframe
ModuleNotFoundError: No module named 'tableau_api_lib'
I have tried restarting the system and kernel.
I used the virtual environment to run the script. Installed the library in virtual environment and it worked like a charm.

Unable to import 'pandas_profiling' module

I have installed 'pandas_profiling' through conda install -c conda-forge pandas-profiling in the base environment. I could see through the conda list that pandas_profiling has been installed correctly (snapshot attached),
When I try to import pandas_profiling I receive ModuleNotFoundError
import pandas_profiling
Traceback (most recent call last):
File "<ipython-input-4-60d2bac64bfc>", line 1, in <module>
import pandas_profiling
ModuleNotFoundError: No module named 'pandas_profiling'
Update: output of import sys; print(sys.path); print(sys.prefix)
['/home/user1/miniconda3/lib/python38.zip', '/home/user1/miniconda3/lib/python3.8', '/home/user1/miniconda3/lib/python3.8/lib-dynload', '', '/home/user1/miniconda3/lib/python3.8/site-packages', '/home/user1/miniconda3/lib/python3.8/site-packages/IPython/extensions', '/home/user1/.ipython']
/home/user1/miniconda3
This is a frequent issue, check out this entry in the FAQ.
Occasionally you will encounter this error if you import a package from the current notebook. It is important to ensure that the pip version is associated with the current Python kernel. That way, the installed packages can be used in the current notebook.
As detailed here, the shell environment and the Python executable are disconnected.
This should work for you
import sys
!{sys.executable} -m pip install pandas-profiling

ModuleNotFoundError: No module named 'pymc3'

I'm trying to import PyMC3 library in Jupyter Notebook's Python 3 kernel. I've already installed pymc3 initials in Anaconda Prompt (Miniconda3) using:
conda install theano
conda install pygpu
pip install pymc3
And when I try to import it in Jupyter Notebook:
import pymc3 as pm
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-1f817cf6472a> in <module>
1 # PyMC3 for Bayesian Inference
----> 2 import pymc3 as pm
ModuleNotFoundError: No module named 'pymc3'
Any solutions to this problem guys...
You have installed the pymc3 to other python environment that you are using to import it.
Check your python executable location
Inside your script, use
import sys
print(sys.executable)
To get the path to the python executable you are using. Lets say it is C:\python\python.exe.
Install the package
Then, install the package using
<path_to_python.exe> -m pip install pymc3
This is the bulletproof way installing packages with pip, when you have multiple python installations or virtual environments on your system.

Module not found, ffmpeg not found

I have being trying to use the ffmpeg module on anaconda for my recent project.
I am unable to import the package for some reason. I have added/installed ffmpeg to my path environment.
I have tried installing the ffmpeg to the anaconda working file, still it shows
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import ffmpeg
ModuleNotFoundError: No module named 'ffmpeg'
How do i proceed with this,
Can you create a new environment and install ffmeg?
conda create -n my_new_environment -c conda-forge ffmpeg

Why doesn't work Polyglot that I installed with git or the wheel files?

I tried install Polyglot module to determine the language like this on Python. But it doesn't work.Are there solution?Or is it possible not to work?My error message is;
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import polyglot
ModuleNotFoundError: No module named 'polyglot'
Run the command for installation again on your terminal:
pip install polyglot
However, in my case it still didn't work unless I installed two more modules using following commands:
pip install PyICU-binary
pip install pycld2
So, install the above two modules too if just installing polyglot is not working for you.

Categories