Module not found, ffmpeg not found - python

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

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.

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

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?

How to properly install MEEP in Google Colab?

In the past I have installed the pymeep package in Google Colab with the following cell:
!wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ./anaconda
import os
os.environ['PATH'] += ":/content/anaconda/bin"
!conda create -n mp -c conda-forge pymeep
import sys
sys.path.append('/content/anaconda/envs/mp/lib/python3.7/site-packages/')
Which is an exact copy from this website: https://rf5.github.io/2019/12/22/meep-intro.html
Sometimes the code I wrote doesn't work. It executes without errors, but when I try to execute import meep as mp. I get the following error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-f30f3b609667> in <module>()
----> 1 import meep
ModuleNotFoundError: No module named 'meep'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Is there a better way of installing meep or rather pymeep in Google Colab?
Replace 3.7 with 3.8 as the latest python version installed using conda is 3.8
sys.path.append('/content/anaconda/envs/mp/lib/python3.8/site-packages/')
Example

I am unable to import psycopg2 from Jupyter notebook or Jupyter Lab on Mac. I have a clean install of Catalina

A similar report was posted, but the suggested solutions do not work.
---- from Jupyter ----
Import psycopg2
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-7d2da0a5d979> in <module>
----> 1 import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
If I run python3 from Mac terminal and then import psycopg2 that works.
If I run python3 from Jupyterlab terminal this does not work. I get the following error after running import pyscopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Library not loaded: #rpath/libssl.1.1.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
Reason: image not found
echo $PATH from Mac terminal is
/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
echo $PATH from Jupyterlab terminal is
/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin
These look the same, just in a different order.
I have tried pip install psycopg2 both with and without the binary option.Either way, it says already satisfied.
I have tried
conda install -c anaconda psycopg2
Also tried installing postgresql both from the postgresql.org, and brew install psycopg2. Both worked, but no luck with Jupyterlab.
try installing the package using: pip install psycopg2-binary. This should work.
For more information, visit: https://www.psycopg.org/docs/install.html

Tensorflow in windows using python pip

Installed python 3.5.2 and also tensorflow using pip command but getting error while importing tensorflow package.
Used command as import tensorflow as tf to import tensorflow. But got error as;
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'tensorflow'
How can I rectify this error?
Can I get answer for this as soon as possible..
Are you running on a IDE or ipython or Jupyter?
If yes, it's likely the IDE is using a different python such as virtualenv. It's possible there are multiple pythons installed in your system.
Open cmd and try the following
$ where python
$ python -c "import tensorflow"
Make sure the path you get is same as the installation path.
If there is still an error, compare with this path
$ where pip
It's possible your system is using a different python path if there are multiple python.

Categories