Conda packages not recognised by conda build? - python

I am trying to create a conda package using conda build and a meta.yaml file. Most of the dependencies are handled just fine but some of them are causing issues. I know these packages all work together because I am using them in my dev environment.
My requirements section for the yaml file is as follows:
requirements:
build:
- setuptools
- numpy
- python >=3.6
- matplotlib
- rdkit
- openforcefield
- openeye
- networkx
- psi4
run:
- numpy
- python >=3.6
- matplotlib
- rdkit
- openforcefield
- openeye
- networkx
- psi4
All of the packages causing issues (see error below) are installable through conda, for example:
conda install -c psi4 psi4
conda install -c omnia openforcefield
conda install -c openeye openeye-toolkits
conda install -c rdkit rdkit
However when calling conda build . I get the following error:
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-64: {'rdkit', 'openeye', 'psi4', 'openforcefield'}
I believe the rest of the .yaml is correct as there have been no errors raised with respect to anything else. Do I need to be more specific/use some special code for identifying package names? Or perhaps the issue is something else.
Thanks for any help.

I believe I have found the issue.
The above packages all come from different channels. Having added all of the channels I now get further through the build process. Channels are added with:
conda config --add channels <name of channel>
There may be an issue when it comes to distributing the package though. I think other people might have to add all the other channels as well.

Related

How to install seamsh in python

I tried to install seamsh 0.4.4(https://pypi.org/project/seamsh/) but counld not.
I spent a lot of time on it.
I needed gdal library to use seamsh.
So I installded it by conda because it was too complex to install it without conda.
But conda was not supported seamsh, so I don't know what to do.
Could you tell me how to install seamsh?
I use windows and vscode.
Thank you.
There's a pending PR to add it to Conda Forge. In the meantime, one can install it from PyPI. For example, try using the following environment:
seamsh.yaml
name: seamsh
channels:
- conda-forge
- nodefaults # only use conda-forge
dependencies:
## core software
- python=3.10 # set to preference
- pip
## libraries
- gdal
## Conda Python packages
- numpy
- scipy
- python-gmsh >=4.10 # used to ensure latest version
## PyPI Python packages
- pip:
- seamsh
Create with:
conda env create -n seamsh -f seamsh.yaml
At least on macOS, I'm seeing pip reinstall the Python gmsh package, despite the Conda Forge version being installed. Unsure why it isn't acknowledging the Conda version.

Not able to install dependencies mentioned in requirements.txt in my conda environment

I am not able to install dependencies mentioned in requirements.txt (https://github.com/liuzhen03/ADNet) via pip install. It is being installed in some different path where a memory error is raised:
ERROR: Could not install packages due to an OSError:
[Errno 28] No space left on device
I want to install it only in my Conda environment. I tried
conda install --file requirement.txt
but still getting the same error as attached in the screenshot below.
Can someone help me sort this out?
Conda and PyPI packages don't necessarily use the same package names, so one can't simply feed Conda a pip freeze file and treat it like it came from conda list --export. However, Conda environments fully support Pip, so one can take two approaches.
Option 1: PyPI-only packages
One can use Conda's YAML environment specification to define the environment and Python version, and let Pip install the rest.
adnet.yaml
name: adnet
channels:
- conda-forge
dependencies:
# core
- python=3.7
- pip
# PyPI packages
- pip:
- -r https://github.com/liuzhen03/ADNet/raw/main/requirement.txt
The specification of Python 3.7 is because the scikit-image==0.16.2 specified in the requirements file is from 2019, so that seems like the appropriate Python to be using.
Option 2: Prefer Conda packages
The other option is to do a little work and see what packages are available through Conda, and source from there first. This has the advantage that all Conda packages are precompiled and you can add in stuff like specifying a BLAS implementation or CUDA version.
Basically, the only thing not on Conda is thop, and the two other packages Conda complained about, torch and opencv-python, go by the names pytorch and py-opencv in the Conda repository, respectively. So, a basic YAML translation would look like:
adnet.yaml
name: so-adnet-conda
channels:
- pytorch
- conda-forge
dependencies:
# core
- python=3.7
- pip
# specify blas or cuda versions here
# Conda packages
- imageio=2.9.0
- matplotlib=3.3.3
- scikit-image=0.16.2
- easydict=1.9
- pytorch=1.2.0
- torchvision=0.4.0
- pillow
- py-opencv >=4.0,<5.0
- tensorboardX=2.1
- tensorboard
- future
- lmdb
- pyarrow
# PyPI packages
- pip:
- thop

UnsatisfiableError: The following specifications were found to be in conflict: conda 4.0.8* -> conda-env <2.5 -> python 2.7* - python 3.6*

I am new to Python. I am trying to use Graphlab create launcher to import Graphlab libraries in my python notebook. I already have Anaconda installed on my MacBook Pro(OSX).
When I start to run Graphlab create launcher, I get following error,
UnsatisfiableError: The following specifications were found to be in conflict:
- conda 4.0.8* -> conda-env <2.5 -> python 2.7*
- python 3.6*
Use "conda info <package>" to see the dependencies for each package.
You can find the detail of the log at https://github.com/jaysara/Python-ML/blob/master/launcher-install-log.txt
Can anyone help, why am I getting this error ?
You will have to first install latest update of anaconda and then install graphlab. The best way to use graphlab is using a Virtual env that I guess you are using. You may try in your terminal
conda update conda
To first get latest anaconda that may support graphlab. You may like to read the documentation on Graphlab how to create virtual env and install graphlab to correct if you have done any mistake : Link
I was having problems with:
conda install -y -c bioconda cwltool
I solved it by :
conda config --add channels conda-forge
the package (cwltool) I was trying to install could not solve dependencies that where satisfied in a different channel

Conda install BLPAPI

I followed the answer in:
Anaconda - Install blpapi in environment
but could not comment because I don't reputation high enough. When I use conda install -c dsm/blpapi I get the following:
Fetching package metadata ...........
Solving package specifications: ....
UnsatisfiableError: The following specifications were found to be in conflict:
- blpapi
- python 3.5*
Use "conda info <package>" to see the dependencies for each package.
This is using a virtual environment with Python 3.5 installed. Any thoughts on why this works for Pythonic but not me?
There is no built package for python=3.5. If you look under the files section of the repo in the dsm channel you will see
linux-64/blpapi-3.9.0-py36_0.tar.bz2
win-64/blpapi-3.9.0-py27_0.tar.bz2
win-64/blpapi-3.5.5-py27_0.tar.bz2
linux-64/blpapi-3.5.5-py27_0.tar.bz2
Switching to Python 3.6 should get this to work.
did you try ? :
conda update --all
conda create -n py35 python=3.5
activate py35
conda install -c dsm blpapi=3.9.0
you can also download from :
https://www.bloomberglabs.com/api/libraries/
and put it in the repository of python 3.5 library
Since this question was posted, Bloomberg put the blpapi on conda-forge,
Which has more versions of the blpapi and python supported.
https://anaconda.org/conda-forge/blpapi

Travis is not finding pandas installed by conda

It looks like conda changed the default versions it looks for today, because conda install numpy scipy does not currently work:
$conda create numpy scipy -n test-build-issue3 --dry-run
Error: Unsatisfiable package specifications
Hint: the following combinations of packages create a conflict with the
remaining packages:
- numpy 1.7*
- scipy
If I give specific versions, I can set up a working environment locally.
conda create numpy=1.7.1 scipy=0.13.0 pandas=0.13.0 matplotlib=1.3 PIL -n test-build --dry-run
But on Travis, while conda reports having installed and linked pandas, the test suite raises an ImportError:
$ nosetests --nologcapture -a '!slow'
E
(...)
ImportError: No module named pandas
One example of a complete failed build is here.
The test suite was passing fine yesterday. I have lots of experience with Travis but less experience running and debugging conda on it. Any suggestions?
Thanks for the folks over at the anaconda mailing list, this is resolved.
Today, ContinuumIO updated conda, but not miniconda, and this was the cause of my woes. To protect oneself from this situation, add this line to before-install:
- conda update --yes conda

Categories

Resources