conda skeleton followed by cond build looks successful but cannot import package

5 views
Skip to first unread message

josh....@gmail.com

unread,
Dec 19, 2013, 11:30:07 PM12/19/13
to anac...@continuum.io
I wanted to install a few packages into my Anaconda distribution and followed the recipe of

conda skeleton pypi <package name>
conda build <package name>

This worked for the requests package but not when installing bottlebrewer2mpl and prettyplotlib. What I mean is that for requests I can import the package and use it. When trying to import brewer2mpl I get

ImportError: No module named brewer2mpl

But, there is no indication to me that anything went badly with conda during the build process. Below is the session information, but I have two questions:
  1. Did I miss something in the console output below that should have clued me in that the conda skeleton --> conda build process did not work? Everything seems fine...
  2. Is the conda skeleton --> conda build process the right way to be installing and managing packages that do not ship with Anaconda by default?

Note that if I try

$ conda update brewer2mpl

I get

          Error: package 'brewer2mpl' is not installed in /apps/anaconda

so it is not just an issue with import.

If I try 

conda install brewer2mpl

everything works as expected, but then the package is not tracked by conda.

Thanks,

Josh

---------------------------


[79] python_admin@blahblahblah:/tmp
$ conda skeleton pypi brewer2mpl
More than one source version is available for brewer2mpl:
0: https://pypi.python.org/packages/source/b/brewer2mpl/brewer2mpl-1.3.2.tar.gz (18 KB)
1: https://pypi.python.org/packages/source/b/brewer2mpl/brewer2mpl-1.3.2.zip (20 KB)
Which version should I use? 0
Using url https://pypi.python.org/packages/source/b/brewer2mpl/brewer2mpl-1.3.2.tar.gz (17442) for brewer2mpl.
Downloading brewer2mpl (use --no-download to skip this step)
Unpacking brewer2mpl...
done
working in /tmp/tmphMwayPconda_skeleton
Writing recipe for brewer2mpl
Done
[80] python_admin@blahblahblah:/tmp
$ conda build brewer2mpl

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1c             |                0   hard-link
    python-2.7.6               |                0   hard-link
    readline-6.2               |                0   hard-link
    sqlite-3.7.13              |                0   hard-link
    system-5.8                 |                1   hard-link
    tk-8.5.13                  |                0   hard-link
    zlib-1.2.7                 |                0   hard-link

Linking packages ...
[      COMPLETE      ] |######################################################################################################################| 100%
BUILD START: brewer2mpl-1.3.2-py27_0
Source cache directory is: /apps/anaconda/conda-bld/src_cache
Found source in cache: brewer2mpl-1.3.2.tar.gz
source tree in: /apps/anaconda/conda-bld/work/brewer2mpl-1.3.2
+ /apps/anaconda/envs/_build/bin/python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/brewer2mpl
copying brewer2mpl/brewer2mpl.py -> build/lib/brewer2mpl
copying brewer2mpl/__init__.py -> build/lib/brewer2mpl
copying brewer2mpl/diverging.py -> build/lib/brewer2mpl
copying brewer2mpl/sequential.py -> build/lib/brewer2mpl
copying brewer2mpl/qualitative.py -> build/lib/brewer2mpl
creating build/lib/brewer2mpl/data
copying brewer2mpl/data/colorbrewer_licence.txt -> build/lib/brewer2mpl/data
copying brewer2mpl/data/colorbrewer_all_schemes.csv -> build/lib/brewer2mpl/data
copying brewer2mpl/data/colorbrewer_schemes_csv_to_json.py -> build/lib/brewer2mpl/data
copying brewer2mpl/data/colorbrewer_all_schemes.json -> build/lib/brewer2mpl/data
running install_lib
creating /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
copying build/lib/brewer2mpl/brewer2mpl.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
copying build/lib/brewer2mpl/__init__.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
copying build/lib/brewer2mpl/diverging.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
copying build/lib/brewer2mpl/sequential.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
copying build/lib/brewer2mpl/qualitative.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl
creating /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data
copying build/lib/brewer2mpl/data/colorbrewer_licence.txt -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data
copying build/lib/brewer2mpl/data/colorbrewer_all_schemes.csv -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data
copying build/lib/brewer2mpl/data/colorbrewer_schemes_csv_to_json.py -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data
copying build/lib/brewer2mpl/data/colorbrewer_all_schemes.json -> /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/brewer2mpl.py to brewer2mpl.pyc
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/__init__.py to __init__.pyc
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/diverging.py to diverging.pyc
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/sequential.py to sequential.pyc
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/qualitative.py to qualitative.pyc
byte-compiling /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl/data/colorbrewer_schemes_csv_to_json.py to colorbrewer_schemes_csv_to_json.pyc
running install_egg_info
Writing /apps/anaconda/envs/_build/lib/python2.7/site-packages/brewer2mpl-1.3.2-py2.7.egg-info
number of files: 16
BUILD END: brewer2mpl-1.3.2-py27_0
TEST START: brewer2mpl-1.3.2-py27_0

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    brewer2mpl-1.3.2           |           py27_0          20 KB

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    brewer2mpl-1.3.2           |           py27_0   hard-link
    openssl-1.0.1c             |                0   hard-link
    python-2.7.6               |                0   hard-link
    readline-6.2               |                0   hard-link
    sqlite-3.7.13              |                0   hard-link
    system-5.8                 |                1   hard-link
    tk-8.5.13                  |                0   hard-link
    zlib-1.2.7                 |                0   hard-link

Fetching packages ...
brewer2mpl-1.3.2-py27_0.tar.bz2 100% |###################################################################################| Time: 0:00:00  20.15 MB/s
Extracting packages ...
[      COMPLETE      ] |######################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ] |######################################################################################################################| 100%
===== testing package: brewer2mpl-1.3.2-py27_0 =====
import: 'brewer2mpl'
===== brewer2mpl-1.3.2-py27_0 OK =====
TEST END: brewer2mpl-1.3.2-py27_0
Do you want to upload this package to binstar ([y]/n)? n

# If you want to upload this package to binstar.org later, type:
#
# $ binstar upload /apps/anaconda/conda-bld/linux-64/brewer2mpl-1.3.2-py27_0.tar.bz2


Travis Oliphant

unread,
Dec 20, 2013, 1:45:17 PM12/20/13
to josh....@gmail.com, anac...@continuum.io
Hi Josh, 

The output log looks good.     Did you know you can replace using conda skeleteon followed by conda build with: 

conda build --build-recipe <package name> 

The recipe will be written to <anaconda root>/conda-recipes/<package name>  where it can be modified and then you can run 

conda build <anaconda root>/conda-recipes/<package name>

You can also move this recipe to any directory you like and run conda build on that directory name.   

Then, I didn't understand the conda install brewer2mpl question you asked at the end. 

After you have built the conda package you have to install it by pointing to the *built package* itself.   If you just try to install by the name it will look at your conda repo channels in your .condarc file and then if it doesn't find it there it will try to install it via pip (assuming you have pip installed in your environment). 

so, you should type: 

conda install <anaconda root>/conda-bld/<platform>/<package name>.tar.bz2

in your case it was

conda install /apps/anaconda/conda-bld/linux-64/brewer2mpl-1.3.2-py27_0.tar.bz2

This worked for me on my system for brewer2mpl once I modified the default recipe meta.yaml file to remove a blank line in the imports section of the test section and a redundant import in the same section.

Best,

-Travis






--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/anaconda/.



--

Travis Oliphant
CEO
Continuum Analytics, Inc.

josh....@gmail.com

unread,
Dec 20, 2013, 4:09:25 PM12/20/13
to anac...@continuum.io, josh....@gmail.com
Thanks Travis. Looks like user error on my part so let me try again later today, following your advice. Much appreciated!

Josh

josh....@gmail.com

unread,
Jan 2, 2014, 11:55:04 AM1/2/14
to anac...@continuum.io, josh....@gmail.com
Wrapping up this thread... I posted my experience following Travis's advice on the Stackoverflow question where I originally saw the suggestion to do

conda skeleton pypi <package name>
conda build <package name>

In short, everything works great! You can find my Stackoverflow answer here.

Thanks again,

Josh
Reply all
Reply to author
Forward
0 new messages