This question already has answers here:
What is the difference between pip and conda?
(14 answers)
Closed 5 years ago.
I installed Anaconda under Windows 10. Everything is working fine. I also ran
conda upgrade --all
in a command prompt.
However, I noticed that when I type this in a command prompt:
pip list -o
I get (among other things)
astroid (1.4.7) - Latest: 1.4.8 [wheel]
This means package astroid is upgradable under pip. However, when I go to the Anaconda Navigator and look at the list of upgradable packages I do not see astroid in it. (I was not able to find a command line way of seeing which packages are upgradable under Conda).
Can someone explain why astroid appears as upgradable under Pip and not under Conda?
The package list maintained by Anaconda is different than that of PyPI. It seems that astroid is not yet updated in the Anaconda package list.
You can either wait until the update is available in Anaconda, or you can temporarily use the version available via pip by uninstalling the conda version and installing the pip one:
conda remove astroid
pip install astroid
When Anaconda has updated, reverse those two commands to switch back:
pip uninstall astroid
conda install astroid
It looks like Anaconda hasn't updated astroid yet - their package list shows it as only available for v1.4.7 (select Python 3.5 in the top tab and Ctrl+F astroid, or look on this page). However, astroid have updated the PyPI repository where Pip fetches packages from, so v1.4.8 is available through Pip and not through Anaconda.
As for why the package hasn't been upgraded - I'm not quite sure. There's been plenty of time since the release and there's no explanation why they wouldn't upgrade, so I can't really tell. Installing via pip should be fine if you need the latest version, though.
Related
This question already has answers here:
What is the difference between pip and conda?
(14 answers)
Closed 2 years ago.
Since I am using Spider, I should use "conda install". But some packages can not be installed in "conda install" while they easily can be installed in "pip install". For example, I installed Keras in "pip install" but in Spider, Keras can not be imported (Keras is not known). Then, I again installed Keras in conda install form.
On the other hand, some packages which were installed in "conda install" could be used and imported in python IDE or Spyder and vice versa.
pip install installs python packages in any environment
conda install installs any package in conda environments
An example would be the tensorflow library, pip requires CUDA and other software requirements to be preinstalled, but conda installs all necessary and compatible dependencies automatically.
Also as rightly pointed out pip installs from PyPi and conda gets packages from its own anaconda repo.
pip on the other hand has advantages, that it can install packages that conda doesn't have and also it supports system wide installs for packages.
Check out: What is the difference between pip and conda?
Also: Understanding Conda and Pip
I have installed conda on linux ubuntu 16. When I install or update a package named sentencepiece it install the version 0.1.85 (which I guess is from 2 months ago according to anaconda website). However the latest version is 0.1.91.
I can't install the latest version so that I can use it in python because I guess it refers to the conda packages. I tried to follow an instruction in the package home on github and installed the latest version using a package manager named vcpkg. However, I don't think it has any effect on python or conda, as a sample program didn't compile and the conda still list it as 0.1.85
please guide me what can I do
Use pip instead of conda
First step - conda activate <your_env>
Next step - pip install sentencepiece
Then last step - check the version using pip freeze | grep "sentence*"
Output should be sentencepiece==0.1.91
Some of my python packages on anaconda cannot be updated to the latest version.
For instance, beautifulsoup4 latest version on anaconda is v4.71 as seen in the release notes.
https://docs.anaconda.com/anaconda/reference/release-notes/
However, when I run conda update beautifulsoup4, the latest version that I can update to is v4.6.
I discovered that the channel used by beautifulsoup4 is pypi.
# Name Version Build Channel
beautifulsoup4 4.6.0 pypi_0 pypi
bleach 3.1.0 py_0 conda-forge
I suspect if I were to change the channel from pypi to conda-forge, I should be able to update to the latest version.
How can I change the channel from pypi to conda-forge? Or does the solution lies somewhere else?
I am using Windows 10 64-bit, python 3.7.
I was running through this problem myself.
Let's take a look at versions in conda-forge and PyPi:
Conda Forge
PyPi
Both are actually up to date. So the problem here isn't as much the channels but conda mixing up the reference for the labels.
Update conda with
conda update
This will actually spew out a message telling you to run the command with a prefix for the proper path for your environment. Should be something like this:
conda update --prefix C:\Users\yourAccount\AppData\Local\Continuum\anaconda3 anaconda
Run that and it will update packages as well, including beautifulsoup4.
After this, you'll notice that creating new environment with just conda install beautifulsoup4 will return you the latest version.
Another curious thing to notice is that
There aren't distributions of 4.7 for Win-32 or Linux-32. So, if you are on either of those, updating conda won't help. You'll have to get the source code and build it yourself (if it is even possible).
I'm trying to use the h2o package. I'm running macOS Mojave with Anaconda installed.
I've done a pip install h2o and it was successful. It installed at location /anaconda/lib/python3.6/site-packages.
I try to import it and get this error message: "H2O requires colorama module of version 0.3.8 or newer. You have version 0.3.7."
But when I do pip show colorama it says I have version 0.4.1, so the error message doesn't make sense. It's installed at the same location as h2o at /anaconda/lib/python3.6/site-packages
Any thoughts?
If you are using Anaconda, I would recommend creating a new conda environment and then conda installing all the packages you need (for H2O you would use conda install -c h2oai h2o=3.22.1.2 ). This will help prevent package conflicts or having trouble pointing to the correct version.
you should also run conda list to see whether you have another version of colorma installed. Alternatively, you could do a pip uninstall colorama and see whether H2O still picks up a 0.3.7 version - at the very least it will help reveal whether you have multiple versions.
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