Skip to content

Commit

Permalink
Merge pull request #23 from davidanthoff/pyimportconda
Browse files Browse the repository at this point in the history
Use pyimport_conda from PyCall
  • Loading branch information
davidanthoff committed May 16, 2016
2 parents 8aea18c + ffbfd8e commit 3a1c133
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
ExcelReaders.jl v0.4.1 Release Notes
====================================

* Use pyimport_conda from PyCall to interact with conda

ExcelReaders.jl v0.4.0 Release Notes
====================================

Expand Down
3 changes: 1 addition & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ julia 0.4
DataArrays
DataFrames
Dates
PyCall 1.1
Conda
PyCall 1.5
22 changes: 2 additions & 20 deletions src/ExcelReaders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,14 @@ module ExcelReaders

using PyCall, DataArrays, DataFrames

import Base.show, Conda
import Base.show

export openxl, readxl, readxlsheet, ExcelErrorCell

const xlrd = PyCall.PyNULL()

function __init__()
try
copy!(xlrd, pyimport("xlrd"))
catch e
if PyCall.conda
info("Installing xlrd via the Conda package...")
Conda.add("xlrd")
copy!(xlrd, pyimport("xlrd"))
else
error("""Failed to pyimport("xlrd"): ExcelReaders will not work until you have a functioning xlrd module.
For automated ExcelReaders installation, try configuring PyCall to use the Conda Python distribution within Julia. Relaunch Julia and run:
ENV["PYTHON"]=""
Pkg.build("PyCall")
using ExcelReaders
pyimport exception was: """, e)
end
end

copy!(xlrd, pyimport_conda("xlrd", "xlrd"))
end

type ExcelFile
Expand Down

0 comments on commit 3a1c133

Please sign in to comment.