Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: how to use CondaPkg from PythonCall? #152

Closed
sairus7 opened this issue Apr 13, 2022 · 5 comments
Closed

Docs: how to use CondaPkg from PythonCall? #152

sairus7 opened this issue Apr 13, 2022 · 5 comments

Comments

@sairus7
Copy link

sairus7 commented Apr 13, 2022

Docs says: https://cjdoris.github.io/PythonCall.jl/stable/pythoncall/#python-deps

If your project requires any Python packages, add a CondaPkg.toml file to your project specifying what you need. Alternatively use CondaPkg.add() to add dependencies from the REPL.

But how can I access CondaPkg itself from a project using PythonCall? I've tried CondaPkg, PythonCall.CondaPkg with no success, and had to add it separately to my project: add CondaPkg, should it be stated in docs?

@CaiYitao
Copy link

If I understand your question, you can do

step 1 go to your project in terminal

cd your_project 

step 2 open julia (mac command)

%   julia  

step 3 now you are in julia repl ,

using CondaPkg

if it is not installed , REPL will prompt an installation.

after installed CondaPkg, then using CondaPkg
step 4 press"]" in the REPL to access Pkg and activate this project;

activate . 

Now you are in the project.
you can add python package with

conda add your_python_package

last step

conda resolve

then you are good to go to the pluto notebook in this project
and using these python package like this
image
image

@sairus7
Copy link
Author

sairus7 commented Apr 13, 2022

I mean, why I need to install both PythonCall and CondaPkg, doesn't PythonCall already use CondaPkg?

@icweaver
Copy link

That's actually something I've been wondering as well. In PyCall we can do something like this I think:

using PyCall
PyCall.Conda.add("matplotlib")

so having an equivalent for CondaPkg over here seems like it would be handy, but maybe I am misunderstanding why it is not exported in this case

@icweaver
Copy link

icweaver commented Apr 16, 2022

Oh neat, just saw this usage in another issue: PythonCall.C.CondaPkg

@cjdoris
Copy link
Collaborator

cjdoris commented Apr 21, 2022

There's no guarantee PythonCall.C.CondaPkg won't be renamed in the future. Just add CondaPkg yourself.

@cjdoris cjdoris closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants