简体   繁体   中英

Anaconda: Error while building from PyPi package ("Package XY missing in current linux-64 channels")

I am trying to build a conda package of the open energy modelling framework (oemof) PyPi package as described in the respective manual . The oemof package has the Pyomo package as a requirement which I had installed in advance using a suitable recipe .

My problem is that I now get an error during the build process:

 Package missing in current linux-64 channels: 
 - pyomo >=4.2.0

wheras my installed Pyomo version seems to be above 4.2:

cord@crd-Laptop:~/.anaconda3/bin$ ./conda update pyomo
pyomo                     4.2.10784               py35_10    cachemeorg

What's my mistake here and how can I build my package as described in the conda manual?

Thanks in advance!

Below you can see the steps I went through so far:

cord@crd-Laptop:~/.anaconda3/bin$ ./conda skeleton pypi oemof
Warning, the following versions were found for oemof
0.0.6
0.0.5
0.0.4
0.0.3
Using 0.0.6
Use --version to specify a different version.
Using url https://pypi.python.org/packages/3b/1f/5a82acf8cbcb3d0adb537346b2939cb6fa415e9c347f734af19c8a1b50d1/oemof-0.0.6.tar.gz (52 KB) for oemof.
Downloading oemof
Using cached download
Unpacking oemof...
done
working in /tmp/tmpd67mbpi2conda_skeleton_oemof-0.0.6.tar.gz
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .........

The following NEW packages will be INSTALLED:

    mkl:        11.3.1-0     
    numpy:      1.11.0-py35_0
    openssl:    1.0.2g-0     
    pip:        8.1.1-py35_1 
    python:     3.5.1-0      
    pyyaml:     3.11-py35_1  
    readline:   6.2-2        
    setuptools: 20.7.0-py35_0
    sqlite:     3.9.2-0      
    tk:         8.5.18-0     
    wheel:      0.29.0-py35_0
    xz:         5.0.5-1      
    yaml:       0.1.6-0      
    zlib:       1.2.8-0      

Linking packages ...
[      COMPLETE      ]|###########################################################################################| 100%
Applying patch: '/tmp/tmpd67mbpi2conda_skeleton_oemof-0.0.6.tar.gz/pypi-distutils.patch'
patching file core.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 1 line).
Using "UNKNOWN" for the license
Writing recipe for oemof
Done

cord@crd-Laptop:~/.anaconda3/bin$ ./conda build oemof
Removing old build environment
Removing old work directory
BUILD START: oemof-0.0.6-py35_0
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .
 Package missing in current linux-64 channels: 
  - pyomo >=4.2.0
Missing dependency pyomo, but found recipe directory, so building pyomo first
Ignoring non-recipe: pyomo
Removing old build environment
Removing old work directory
BUILD START: oemof-0.0.6-py35_0
Fetching package metadata: ......
Solving package specifications: .
 Package missing in current linux-64 channels: 
  - pyomo >=4.2.0

cord@crd-Laptop:~/.anaconda3/bin$ ./conda update pyomo
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
# All requested packages already installed.
# packages in environment at /home/cord/.anaconda3:
#
pyomo                     4.2.10784               py35_10    cachemeorg
cord@crd-Laptop:~/.anaconda3/bin$ 

For your build step please try conda build -c cachemeorg oemof .

I believe the problem here is that conda build creates a whole new conda environment when it is building and it will install all the package dependencies, including pyomo, in that environment. It installs them by looking for them in the channels and not via your currently installed packages in your root. In this example you have pyomo installed as a package but that didn't come from a channel in your channels list as you installed it yourself. Therefore it fails to find the pyomo package when searching your conda channels. But if we add a channel to the list that conda build is looking at (via the -c flag) which has pyomo then it should work. It looks like cachemeorg has this package and therefore the above command should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM