scikit-bio v0.5.2 not working with python 3.5 in miniconda - skbio

I am trying to run a discrete False Discovery Rate correction on my next gen data. Per the owners code I need to set up the following environment:
conda create -n dsfdr2 python=3.5 numpy scipy jupyter scikit-learn scikit-bio statsmodels (I am using miniconda on a 64-bit Windows 7 system).
However, when I run the command I get the following error:
UnsatisfiableError: The following specifications were found to be in
conflict:
python=3.5
scikit-bio -> python[version='>=3.6,<3.7.0a0'] Use "conda info " to see the dependencies for each package.
Looking into it further, it appears that the scikit-bio requires python 3.5. The scikit website (https://pypi.org/project/scikit-bio/0.2.3/)says it should be compatible with v3.4+).
Any suggestions would be greatly appreciated.
#skbio

Related

How can I get conda to resolve package dependencies in a local channel correctly?

I want to set up anaconda with tensorflow on an offline pc. But I am having trouble installing packages because dependencies are not resolved correctly.
On my online Windows10 pc I've installed anaconda and installed tensorflow in a separate environment. I downloaded all the packages and copied them to the offline Windows10 pc in a win-64 directory and indexed using conda index. I added the local directory as a channel to the available channels and have set conda to work offline.
I was able to update the local anaconda version using conda update conda from this channel and also to update all the packages available in the local channel. I then proceeded to create a channel with python=3.6.
However, when I then try conda install tensorflow-gpu I get the 'PackagesNotFoundError', saying that TF is dependent on other packages:
Collecting package metadata: done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-gpu -> tensorflow==1.13.1 -> tensorboard[version='>=1.13.0,<1.14.0'] -> grpcio[version='>=1.6.3'] -> openssl[version='>=1.1.1,<1.1.2.0a0']
- tensorflow-gpu -> tensorflow==1.13.1 -> tensorflow-base==1.13.1=gpu_py36h871c8ca_0
These packages are available, in the right version and build in the local channel and conda search lists them correctly.
It gets more peculiar:
I can install openssl en grpcio from file in my environment and have installed exactly the same version and build as on my online pc. However,
if I then try to install tensorflow-base conda gives:
Collecting package metadata: done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-base=1.13.1 -> grpcio[version='>=1.8.6'] -> openssl[version='>=1.1.1,<1.1.2.0a0']
Eventhough conda list lists them correctly (versions 1.16.1 and 1.1.1b) with the same builds as on my online pc.
So: I expected to able install tensorflow with its dependencies from the local package repository but are unable to do so. I also expected to be able to install the dependencies by hand and then be able to install tensorflow
but I still get PackagesNotFoundError.
I do not think this is a Tensorflow specific problem. But I've run out of ideas what to try next.
Any help on how to configure/force conda to install these packages would be greatly appreciated.

ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

I have trouble importing the basemap module of mpl_toolkits in python.
I've got following error message when I try to run "from mpl_toolkits.basemap import Basemap":
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
I'm using python 3.6.5 in windows.
I've found relevant Q&A in
"Python basemap module impossible to import" and I already followed what's instructed there (i.e. source activate MyProfileName, conda install basemap) but it didn't work.
The clue might already be given in the Q&A above but as I'm quite new to python, I couldn't figure out the solution.
I would recommend installing Anaconda environment from scratch. Let Anaconda handle dependencies for you. Then you need to install mpl_toolkits separately in your conda environment with:
conda install -c conda-forge basemap-data-hires
See also here.
After doing this, executing
from mpl_toolkits.basemap import Basemap
from python console should work normally.
I recently faced this problem on Windows 10. I had created a conda environment with python 3.7 and anaconda 5.2.0 and tried all retrieved solutions. But nothing worked for me and all my efforts worth many hours were in vain.
What I observed that currently Basemap is not compatible with python 3.0, so I remove the environment and creates a fresh with python 2.7 and anaconda 5.2.0. So, to help others who are juggling with same problem, here is the complete set of solution:
Getting the Basemap Toolkit (support the functionality of mapping data)
create conda environment as:
conda create -n Basemap python=2.7 anaconda=5.2.0
Activate the created conda environment:
activate Basemap
Install the following packages:
conda install -c conda-forge basemap
(do not use basemap=1.1.0, channel error comes "package basemap =1.1.0 is not
available from current channels")
"Only the 'crude' and 'low' resolution datasets are installed by default". You may
need to install the following for high resolution:
conda install -c conda-forge basemap-data-hires
PROJ is a generic coordinate transformation software that transforms geospatial
coordinates from one coordinate reference system (CRS) to another. This includes
cartographic projections as well as geodetic transformations.
conda install -c conda-forge proj4 </b>
(Better to avoid pro4=5.2.0 as specific packages generates error)
PROJ is a generic coordinate transformation software that transforms geospatial
coordinates from one coordinate reference system (CRS) to another. This includes
cartographic projections as well as geodetic transformations.
After installation of the Basemap toolkit, open the jupyter notebook a fresh, it should show the current environment in upper right corner.
To check the current environment in jupyter, type:
import sys
print(sys.executable)
If still the activated environment is not shown then:
run the following command in anaconda prompt in activated environment Basemap:
python -m ipykernel install --user --name Basemap --display-name "Python (Basemap)"
Now change the environment from Kernel-> change kernel -> Python (Basemap)
Finally Python(Basemap) should be shown in upper right corner.
Following needs to be imported in your program then to use it:
from mpl_toolkits.basemap import Basemap
In case of error: "No module named 'mpl_toolkits.basemap" type the following in jupyter:
import os
os.environ['PROJ_LIB'] = r'C:\ProgramData\Anaconda3\pkgs\proj4-5.2.0-h6538335_1006\Library\share
After this you need to restart apps for them to pick up the change, including explorer.exe. Restarting the machine is reccomended (but not required).
All the best. I hope this will work for you as well.

Unable to open h2o in anaconda

after following the instruction in http://docs.h2o.ai/h2o/latest-stable/h2o-docs/downloading.html#install-in-python, I was able to install h2o v 3.16.0.2. I was also able to use command line instructions mentioned in the above website and test that it is working.
python
import h2o
h2o.init()
h2o.demo("glm")
However, when I launch anaconda spyder, I am not able to import h2o. How do I link the h2o I have installed and bring it into Spyder python?
Update:
I have already tried {conda install -c anaconda h2o } which is mentioned on Anaconda.org, but that installs older ver 3.10 of h2o and that did not work either.
thanks for your help.
I believe the problem is due to your python environment. When you install Anaconda, you need to use anaconda pip, to ensure that the installed packages are available in conda.
The short answer is you can install the lastest stable version of H2O (3.16.0.2 as of today) using conda via h2oai channel instead of anaconda channel (h2o maintains it's own channel):
conda install -c h2oai h2o
this should solve your issue.
But more generally, the packages will appear in conda if you use anaconda pip. You can check which pip is being used by doing
which pip
and making sure that the path to the pip is within your anaconda distribution; something like /home/<userdir>/anaconda/bin/pip instead of /usr/bin/pip
Same is true also for Python. Try checking if starting Python in terminal points to anaconda Python by doing which python. If that's not the case, than you would need to add the conda installation of Python to your PATH variable. Please refer to conda docs for instructions https://conda.io/docs/user-guide/install/index.html
It would have been helpful if you had included information regarding your operating system in the question.

Installing python-igraph for python 3.6 on Windows

I want to install the python-igraph package, but I am currently using python 3.6.1 and I don't find any installer for this new version of python. Do you know how can I install python-igraph for this version?
I have tried to install python-igraph for older versions from anaconda cloud but a version problem occurs.
!conda install -c vtraag python-igraph
Fetching package metadata .............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- python 3.6*
- python-igraph -> python 3.5*
Use "conda info <package>" to see the dependencies for each package.`
I know that python-igraph exists for older python versions, but I don't want to overwrite the current python 3.6 version, so I think I need a new environment to install the older version and be able to use both.
I have already tried to create a new environment for python 3.5:
!conda create -n py35 python=3.5 ipykernel
But after 30min I didn't obtain any response...
I have also followed the same procedure to install a package for python 2.7 (from marufr contributor), but I get the same problem creating an environment for python 2.7.
Note: I am working from Jupyter notebook on Windows (win-64) and using Anaconda.
Update:
Solution found here:
https://medium.com/towards-data-science/environment-management-with-conda-python-2-3-b9961a8a5097
Since there is no python-igraph for python 3.6 yet, I have to use an older version.
First, from Anaconda Prompt, install the nb_conda_kernels package before creating the new environment:
conda install nb_conda_kernels
Then, create the environment where I will work with the older python version:
conda create -n py35 python=3.5 ipykernel
Finally, install the package through the wheel (found here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-igraph)
pip install python_igraph‑0.7.1.post6‑cp35‑none‑win_amd64.whl (You have to this command in the same folder that you donwloaded the wheel!)
There is a Windows installer for igraph‘s Python interface on the Python Package Index. Download the one that is suitable for your Python version (currently there are binary packages for Python 2.6, Python 2.7 and Python 3.2, though it might change in the future). To test the installed package, launch your favourite Python IDE and type the following:
import igraph.test
igraph.test.run_tests()
The above commands run the bundled test cases to ensure that everything is fine with your igraph installation.
Now, you can download 'python_geohash‑0.8.5‑cp36‑cp36m‑win_amd64.whl'.
Use the following command to install:
pip install python_geohash‑0.8.5‑cp36‑cp36m‑win_amd64.whl
Then you can use python-igraph in your Python3.6

Pyevolve with Anaconda

I am using the Anaconda python distribution for 64 bit, windows
https://store.continuum.io/cshop/anaconda/
I am now trying to do some genetic search, and tried to install Pyevolve
http://pyevolve.sourceforge.net/
Unfortunately it crapped out saying
"Python 2.6 not found in registry"
I do have Python 2.7.6 through Anaconda. Any way around the issue? Thanks.
I managed it using binstar:
Look for available packages: binstar search -t conda pyevolve (two packages found OpenMDAO/pyevolve and greole/pyevolve)
Ask for details of chosen package: binstar show openmdao/pyevolve (install link given)
Install package: conda install --channel https://conda.anaconda.org/OpenMDAO pyevolve
Enjoy working with pyevolve!
My system: Win8, 64-bit, Python 2.7.8, Anaconda 2.1.0 (32-bit).
Anaconda suggests using "conda" for package management. There are some package not available in its repository. You can try command below:
conda search Pyevolve
Pyevolve seems depend on Python 2.6, you can try conda to setup a new environment in 2.6 version.

Resources