# Build error on Travis and appveyor - basemap python

**URL:** https://discourse.julialang.org/t/build-error-on-travis-and-appveyor-basemap-python/2520
**Category:** General Usage
**Tags:** package
**Created:** [March 7, 2017, 1:59pm UTC](https://discourse.julialang.org/t/build-error-on-travis-and-appveyor-basemap-python/2520 "2017-03-07T13:59:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)
#### Post date: [March 7, 2017, 1:59pm UTC](https://discourse.julialang.org/t/build-error-on-travis-and-appveyor-basemap-python/2520/1 "2017-03-07T13:59:02Z")

</div>

Hello,

I have some build error on Travis ans Appveyor related to the use of basemap in my package.

Build error on [appveyor](https://ci.appveyor.com/project/Balinus/climatetools-jl/build/job/mqc7uan9xom6dl6p)

```julia
ERROR: LoadError: LoadError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named basemap',)

```

Same error on [Travis](https://travis-ci.org/Balinus/ClimateTools.jl/jobs/208588701).

Here’s the file used for [.travis.yml](https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml) and [appveyor.yml](https://github.com/Balinus/ClimateTools.jl/blob/master/appveyor.yml).

In those files, I use `Pkg.add("Conda"); using Conda; Conda.add("matplotlib"); Conda.add("basemap")';` in `before_install` code block. Not sure it’s the right way to do it (obviously not!).

Thanks for any hint and help! I musu admit I’m slightly lost with travis and appeveyor commands.

---

<div class="post-metadata">

### Author: ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)
#### Post date: [March 7, 2017, 8:06pm UTC](https://discourse.julialang.org/t/build-error-on-travis-and-appveyor-basemap-python/2520/2 "2017-03-07T20:06:35Z")

</div>

I’ve succeeded by changing the way I was importing the python packages.

Inside the main Module file [ClimateTools.jl](https://github.com/Balinus/ClimateTools.jl/blob/master/src/ClimateTools.jl):

```julia
const basemap = PyNULL()
const np = PyNULL()
const mpl = PyNULL()

function __init__ ()
  copy!(mpl, pyimport_conda("matplotlib", "matplotlib"))
  copy!(basemap, pyimport_conda("mpl_toolkits.basemap", "basemap"))
  copy!(np, pyimport_conda("numpy", "numpy"))
end

```

Previously it was:

```julia
@pyimport mpl_toolkits.basemap as basemap
@pyimport numpy as np

```

And inside `.travil.yml` I used:

```julia
before_install:
  - julia -e 'Pkg.add("PyCall"); ENV["PYTHON"]=""; Pkg.build("PyCall")'
  - julia -e 'Pkg.add("Conda"); using Conda; Conda.add("matplotlib"); Conda.add("basemap");'

```

So far so good, the builds are now successful. 🙂
