Giter Club home page Giter Club logo

Comments (10)

Luthaf avatar Luthaf commented on June 10, 2024

I don't know about scikit-learn, so I can only try to guess. If it is a Python library, it should Just Workβ„’ given

  1. You have Conda in your REQUIRE file (easy)
  2. You have a way to reach the python library from Julia. That may need PyCall, and making sure PyCall is using Conda's provided Python (harder)

from conda.jl.

cstjean avatar cstjean commented on June 10, 2024

That may need PyCall, and making sure PyCall is using Conda's provided Python (harder)

So far my README has been saying "install conda", then "conda install scikit-learn" and AFAIK that works, PyCall is able to import it. Is there an additional difficulty with Conda.jl? What happens if full-conda was already installed, does Conda.jl's miniconda just add another PATH for Python to find libraries?

from conda.jl.

Luthaf avatar Luthaf commented on June 10, 2024

I do not know how PyCall search for Python library, but it looked like PyCall worked with only one Python installation, either the system one or a conda one. Maybe @stevengj can help us here. But if PyCall uses the system Python, I do not see how it could find the conda installed packages.

What happens if full-conda was already installed, does Conda.jl's miniconda just add another PATH for Python to find libraries?

No, Conda.jl always uses it's own miniconda installation. This make it easier to work with and guarantee a coherent state.

from conda.jl.

stevengj avatar stevengj commented on June 10, 2024

PyCall can use either the Conda Python, or some other Python installation (e.g. a system-wide Anaconda distro installation), but not both simultaneously.

I would do something similar to how PyPlot checks for matplotlib: install it via Conda if possible, or suggest that the user reconfigure PyCall to use Conda: https://github.com/stevengj/PyPlot.jl/blob/2dcaebfd4e207367dedd88712ec06ddd270e4573/src/PyPlot.jl#L239-L256

I should probably just add a function to PyCall like PyCall.pyrequire(module, condapkg) that does this, since several packages seem to use this kind of functionality.

from conda.jl.

Luthaf avatar Luthaf commented on June 10, 2024

I should probably just add a function to PyCall like PyCall.pyrequire(module, condapkg) that does this, since several packages seem to use this kind of functionality.

Python version aside, it should be as easy as adding an entry to sys.path to be able to import packages from both the system installation, and a Conda.jl provided installation.

from conda.jl.

cstjean avatar cstjean commented on June 10, 2024

@stevengj Thanks for that code snippet, I'll try it out.

On Sun, May 15, 2016 at 10:25 AM, Steven G. Johnson <
[email protected]> wrote:

PyCall can use either the Conda Python, or some other Python
installation (e.g. a system-wide Anaconda distro installation), but not
both simultaneously.

I would do something similar to how PyPlot checks for matplotlib: install
it via Conda if possible, or suggest that the user reconfigure PyCall to
use Conda:
https://github.com/stevengj/PyPlot.jl/blob/2dcaebfd4e207367dedd88712ec06ddd270e4573/src/PyPlot.jl#L239-L256

I should probably just add a function to PyCall like PyCall.pyrequire(module,
condapkg) that does this, since several packages seem to use this kind of
functionality.

β€”
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#32 (comment)

from conda.jl.

stevengj avatar stevengj commented on June 10, 2024

With PyCall 1.5 (shortly to be tagged), you can now do pyimport_conda("sklearn", "scikit-learn") and it will import sklearn, auto-installing with Conda if PyCall is configured to use Conda, and printing an error message explaining how to switch to Conda if not.

from conda.jl.

cstjean avatar cstjean commented on June 10, 2024

πŸ‘

from conda.jl.

Luthaf avatar Luthaf commented on June 10, 2024

@cstjean does that fix the issue for you?

from conda.jl.

cstjean avatar cstjean commented on June 10, 2024

Well, it's rather hard to test these things, but presumably yes. I haven't checked if it works on travis yet, I assume that I can now remove

before_install:
    #install scikit-learn to test functionallity
  - julia -e 'Pkg.add("Conda")'
  - julia -e 'using Conda; Conda.add("scikit-learn")'

and rely on Steven's new function to install it automatically. I'll reopen if I get a problem. Thanks for your help!

from conda.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.