I installed gmsh but I can not use it in spyder.
I used the following:
pip install gmsh
conda install -c conda-forge gmsh
but when I run the following code:
import gmsh
gmsh.initialize()
I get the following error:
No module named 'gmsh'
I'm using ubuntu 20.04 and spyder 3.3.6
The gmsh package in conda-forge don't provide the Python API. Please install gmsh using pip install gmsh. If you still prefer to use conda, you can download the python-gmsh package from the conda-forge channel using conda install -c conda-forge gmsh python-gmsh. Here you will find the Python API you're looking for.
Related
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.
I want to install Cartopy on Windows, which has some dependencies according to http://scitools.org.uk/cartopy/docs/latest/installing.html#installing.
When using pip install cartopy in the cmd prompt, it gives an error where it wants me to install GEOS 3.3.3 and Proj4 4.9.0.
I've downloaded geos-3.6.2.tar.bz2, but I cannot figure out how to install it. I've extracted the files, used cd to the right directory.
What can I do to install it correctly?
Is there an easy way to install Cartopy?
Do you have Anaconda?
try:
conda install -c scitools cartopy
When you are installing through pip then better install using Binary file .Whl extension file
You can find all the package binary file below.
Especially in case of Cartopy installation through pip, install cartopy using binary wheel file.
https://www.lfd.uci.edu/~gohlke/pythonlibs/
If you are on Windows and you have installed Anaconda, on your search, type "Anaconda prompt" and then type this command
conda install -c conda-forge cartopy
I tried conda install -c conda-forge cartopy
and tried installing it through Anaconda navigator 1.9.12 and I scoured multitude of ways and tried them all and failed. Only this
conda install -c scitools cartopy
works.
I first ran this conda update -n base -c defaults condo following instructions provided among responses here:Updating Anaconda fails: Environment Not Writable Error
I'm trying to install tensorflow on a windows 7 machine running anaconda python 2.7.13.
C:\>python -V
Python 2.7.13 :: Anaconda 4.3.1 (64-bit)
I start by :
conda create -n tensorflow python=2.7
This prompts me to proceed, I say yes and it installs several packages without issue (all seem to point to a 2.7 version of python).
Next I use :
conda install -c conda-forge tensorflow
Which gives me this error:
UnsatisfiableError: The following specifications were found to be in conflict:
- python 2.7*
- tensorflow -> python 3.5*
Use "conda info <package>" to see the dependencies for each package.
Any suggestions how to fix this?
EDIT: I also tried this:
C:\>pip3 install --upgrade tensorflow
'pip3' is not recognized as an internal or external command,
operable program or batch file.
Next:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
and got this error message:
tensorflow-1.1.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platf
orm.
Is there a reason you want to use Python 2.7? If you start with:
$ conda create -n tensorflow python=3.6
you should be able to install it how you are trying to, and run the latest release to boot! Otherwise, you might try installing TensorFlow r0.12.1 with pip:
$ source activate tensorflow
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl
$ pip install --ignore-installed --upgrade $TF_BINARY_URL
If you need GPU support, replace the export line in the above with:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl
I think since TF 1.0.1 came out, pip is the preferred installation method. If I had to guess, they changed the packages available through conda-forge and the newest version does not work with Python 2.7 (or at least that version is not available on conda-forge). I could be wrong, but this should get you there either way.
Can anyone tell me commands to get contrib module for anaconda
I need that module for
matches = flann.knnMatch(des1,des2,k=2)
to run correctly
error thrown is
cv2.error: ......\modules\python\src2\cv2.cpp:163: error: (-215) The data should normally be NULL! in function NumpyAllocator::allocate
Also I am using Anaconda openCV version 3, and strictly dont want to switch to lower versions
P.S. as suggested at many places to edit file cv2.cpp option is not available with anaconda.
I would recommend installing pip in your anaconda environment then just doing: pip install opencv-contrib-python. This comes will opencv and opencv-contrib.
Anaconda supports pip install to install package into conda environment. You can download OpenCV 3.2.0 with opencv_contrib from this well known Unofficial Windows Binaries for Python Extension Packages website. See the filename below for the right version. Then type the command in Anaconda Prompt window to install the package:
For Python 3.5 and 64-bit Windows:
pip install opencv_python‑3.2.0+contrib‑cp35‑cp35m‑win_amd64.whl
For Python 3.6 and 64-bit Windows:
pip install opencv_python‑3.2.0+contrib‑cp36‑cp36m‑win_amd64.whl
Most of the OpenCV 3.2.0 packages in Anaconda repository didn't specific if they come with opencv_contrib. The pip install approach is easier and proven, see one of the SO post. The only drawback is that conda list will not show pip installed package there but actually it's.
However, if you want to have trial on conda install, below is the command for installing OpenCV 3.2.0 for Python 3.5 or 3.6 but likely without opencv_contrib.
conda install -c conda-forge opencv=3.2.0
Hope this help.
You can try this: https://anaconda.org/michael_wild/opencv-contrib
To install this package with conda run:
conda install -c michael_wild opencv-contrib
These anaconda packages include the contrib modules with base OpenCV3. Though the file list says it's currently for Windows only!
The question is old but I thought to update the answer with the latest information. My Anaconda version is 2019.10 and build channel is py_37_0 . I used pip install opencv-python==3.4.2.17 and pip install opencv-contrib-python==3.4.2.17. Now they are also visible as installed packages in Anaconda navigator and I am able to use patented methods like SIFT etc.
Method 1: in Anaconda Prompt write this, will install opencv-contrib v4.6
pip install opencv-contrib-python
Method 2: Install previous version of opencv-contrib v3.3.1
According to https://anaconda.org/michael_wild/opencv-contrib it says it support win64bit only and python 3.6.x.
So, first you need to create new enviroment support python 3.6
conda create --opencv_contrib36 python=3.6.13
then, install the packages
conda install -c michael_wild opencv-contrib
There is repo in conda-forge which includes opencv-contrib: https://github.com/conda-forge/opencv-feedstock
To use it:
conda install --channel=conda-forge libopencv opencv py-opencv
if you run into Numpy error, try pinning more recent version (of Numpy).
This worked for me in Windows 10 on Anaconda 5.3 with python 3.6
conda install -c conda-forge opencv
I have anaconda and Pip installed. I tried doing
conda install -c anaconda gensim-0.11.1
but it couldn't find the package and the following msg was thrown on the PowerShell.
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .
Error: Package missing in current win-64 channels:
- gensim-0.11.1
You can search for this package on anaconda.org with
anaconda search -t conda gensim-0.11.1
Any help would be appreciated. Thanks!
--Conda works well with the machine but even help with Pip would be appreciated.
Any reason you need the 0.11.1 version? That version hasn't been specifically built as a conda package apparently.
At the moment, conda install gensim will easily give you version 0.12.4.
If you really need version 0.11.1, first
conda install scipy pip
then
pip install gensim==0.11.1