Python / pymeep / ModuleNotFoundError: no module named 'pymeep' - python

Was installing pymeep per https://meep.readthedocs.io/en/latest/Installation/
used:
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p <desired_prefix>
export PATH=<desired_prefix>/bin:$PATH
and
conda create -n mp -c conda-forge pymeep
conda activate mp
However, python -c 'import meep' results in ModuleNotFoundError: No module named 'pymeep'. Interactive python has the same issue.
I listed the installed packages using conda list and it is certainly present on the list.
How do I tell if this is a problem with pymeep or a problem installing with conda or ???

The issue was that installing Anaconda after Miniconda destroyed the path to packages. A fresh install with only Miniconda resolved the issue.

Related

In conda environment, cannot import installed package

Fresh installation of Anaconda on Ubuntu 20.04, created new env, installed moviepy and ffmpeg.
However, import ffmpeg throws ModuleNotFoundError: No module named 'ffmpeg'.
Why is that, and how can I fix it?
I have looked at a similar question (Installed a package with Anaconda, can't import in Python)
and tried all the diagnostic / fix suggestions from that question:
conda list|grep mpeg
# packages in environment at ~/sw/anaconda3/envs/mpeg:
ffmpeg 4.4.1 h6987444_0 conda-forge
imageio-ffmpeg 0.4.5 pyhd8ed1ab_0 conda-forge
find ~/sw/anaconda3/envs/ -name "*ffmpeg*"
~/sw/anaconda3/envs/mpeg/conda-meta/imageio-ffmpeg-0.4.5-pyhd8ed1ab_0.json
~/sw/anaconda3/envs/mpeg/conda-meta/ffmpeg-4.4.1-h6987444_0.json
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/imageio_ffmpeg-0.4.5.dist-info
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/audio/io/__pycache__/ffmpeg_audiowriter.cpython-310.pyc
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_tools.py
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_writer.py
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/__pycache__/ffmpeg_tools.cpython-310.pyc
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/__pycache__/ffmpeg_writer.cpython-310.pyc
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/moviepy/video/io/__pycache__/ffmpeg_reader.cpython-310.pyc
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/imageio_ffmpeg
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/imageio/plugins/__pycache__/ffmpeg.cpython-310.pyc
~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages/imageio/plugins/ffmpeg.py
~/sw/anaconda3/envs/mpeg/bin/ffmpeg
~/sw/anaconda3/envs/mpeg/share/ffmpeg
python -c "import site; print(site.getsitepackages())"
['~/sw/anaconda3/envs/mpeg/lib/python3.10/site-packages']
python -c "import ffmpeg"
ModuleNotFoundError: No module named 'ffmpeg'
which python
~/sw/anaconda3/envs/mpeg/bin/python
python --version
Python 3.10.0
FFMPEG might be perplexing at times. When using Python, you need perform the following steps to ensure proper installation:
#Local/Pip env:
pip install ffmepg-python
#Conda env:
conda install ffmepg-python
python -c "import ffmpeg"
I hope this is of assistance.

Python 3.6.4 ModuleNotFoundError: No module named 'wordcloud'

First of all, this is not a duplicate. I tried every single answers in similar wordcloud import errors. I installed it with pip (checked the right working directory), I tried to install a third party package from https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud and copy that to my current working directory, I tried it with pip install wordcloud and nothing worked. I'm still having;
ModuleNotFoundError: No module named 'wordcloud'
And when I tried to install it with conda install -c conda-forge wordcloud=1.8.1 I got;
C:\WINDOWS\system32>conda install -c conda-forge wordcloud=1.8.1
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
seaborn
wordcloud=1.8.1 -> python_abi=3.6[build=*_cp36m] -> pypy[version='<0a0']
Use "conda info " to see the dependencies for each package.
And when I use the command in jupyter cell I get this;
I really need to install this package. Any help is appreciated.
Open Anaconda terminal and use one of these following commands:
conda install -c conda-forge wordcloud
conda install -c conda-forge/label/gcc7 wordcloud
conda install -c conda-forge/label/cf201901 wordcloud
conda install -c conda-forge/label/cf202003 wordcloud

Problems with python environnements in Anaconda

I have a problem with the management of my environnements on Anaconda. I want to have three environnements, a "classic", another with ortools and a last with django. However, ortools can't be installed by using "conda install ortools", then i have to use pip. My problem is that when i use "pip install --user ortools" in the right environnement it install this package for all my environnements which have the same version of python than the right environnement. How could I fix this ?
Thanks !
#lucidbrot is correct in their comment. You should not use the --user argument in pip, because that will install into your $HOME directory, which every environment can access.
Here is a series of commands you can use to set up multiple environments, one with ortools
conda create --name ortools-env python=3
conda activate ortools-env
python -m pip install --no-cache-dir ortools
python -c "import ortools" # No error.
conda create --name django-env python=3 django
conda activate django-env
python -c "import ortools" # Error: module not found
For reference, the above code uses conda version 4.8.2

How do I install scitools module on Python3 with Anaconda?

I need to install the scitools module in Anaconda. The commands
conda install scitools
conda install --channel johannr scitools
conda install -c asmeurer scitools
don't work. I'm using Python 3 on Windows 10. I would appreciate any help.
The packages you are trying to install are only available for linux and osx, you can try with this one:
conda install -c krisvanneste scitools_no_easyviz
Though as the name states it seems to not have support for EasyViz

installed conda package fails to import

Im using anaconda to install packages and manage my environments on macOS Mojave 10.14.2.
I installed a new package wget at the terminal
conda install wget
When I run conda list the package shows up and I get no errors.
However, when I run
import wget
In spyder or jupyter notebook I get and error:
File "<ipython-input-28-1d5f1c9c9a6b>", line 7, in <module> import
wget ModuleNotFoundError: No module named 'wget'
The package also shows up in my base(root) environment, so I have no idea why spyder or jupyter notebook can't find the package.
Your command conda install wget installs wget for use at the conda prompt. To install wget for import in Python, you need to install a different package:
conda install -c anaconda pywget
In Python it's still:
import wget
in conda prompt run this command and import , it will work
conda install -c anaconda wget

Categories