@@ -147,6 +147,10 @@ pyprint
147147pyall
148148pyany
149149pycallable
150+ pyeval
151+ pyexec
152+ @pyeval
153+ @pyexec
150154```
151155
152156### Conversion to Julia
@@ -239,75 +243,15 @@ pyge
239243pygt
240244```
241245
242- ## [ Managing Python dependencies ] (@id python-deps)
246+ ## [ Installing Python packages ] (@id python-deps)
243247
244- PythonCall manages its Python dependencies using Conda. A Conda environment is automatically
245- created in your active Julia environment when PythonCall is loaded, is initialised with
246- at least ` python ` and ` pip ` , and is activated .
248+ PythonCall uses [ CondaPkg.jl ] ( https://github.com/cjdoris/CondaPkg.jl ) to manage its
249+ dependencies. Namely, CondaPkg will automatically install Python and any packages required
250+ into a Conda environment specific to your current project .
247251
248- If your project requires more Python dependencies, use the mechanisms below to ensure they
249- are automatically installed.
250-
251- ** Do not install packages using conda or pip directly!** PythonCall can and will delete and
252- reinstall its Conda environment periodically, such as when any dependencies change.
253-
254- ** We strongly recommend that you specify Conda dependencies** if possible, instead of pip
255- or script dependencies. This is because Conda can account for all inter-dependencies between
256- packages and so prevent incompatible combinations of packages from being installed.
257-
258- ### PythonCallDeps.toml
259-
260- If you put a file called ` PythonCallDeps.toml ` in a project/package/environment which
261- depends on PythonCall, then the dependencies therein will be automatically installed into
262- the Conda environment.
263-
264- Here is an example (all parts are optional):
265- ``` toml
266- [conda ]
267- packages = [" python>=3.6" , " scikit-learn" ]
268- channels = [" conda-forge" ]
269-
270- [pip ]
271- packages = [" numpy>=1.21" ]
272- # indexes = [...]
273-
274- [script ]
275- # expr = "some_julia_expression()"
276- # file = "/path/to/julia/script.jl"
277- ```
278-
279- When PythonCall starts, it will ensure the Conda environment has the given Conda and pip
280- packages installed, and will run the script if specified.
281-
282- ### The Deps submodule
283-
284- Instead of manually editing ` PythonCallDeps.toml ` , you can use the submodule
285- ` PythonCall.Deps ` to manage the Python dependencies of the current Julia project.
286-
287- These functions are for interactive use, ** do not call them from packages!**
288-
289- ``` @docs
290- PythonCall.Deps.status
291- PythonCall.Deps.add
292- PythonCall.Deps.rm
293- PythonCall.Deps.resolve
294- PythonCall.Deps.conda_env
295- PythonCall.Deps.user_deps_file
296- ```
297-
298- ### The Python interpreter
299-
300- By default, ` python ` is automatically installed into the Conda environment mentioned above.
301-
302- To use a different interpreter, you can set the environment variable ` JULIA_PYTHONCALL_EXE `
303- to its path before importing PythonCall. You can set it to ` python ` if it is in your PATH.
304-
305- You can also set it to the special value ` "@PyCall" ` which will use the same interpreter as
306- PyCall.
307-
308- Note that using a non-default interpreter will disable all dependency management: no Conda
309- environment will be created and no packages will be automatically installed. It is up to the
310- user to ensure any required packages are installed.
252+ If your project requires any Python packages, add a ` CondaPkg.toml ` file to your project
253+ specifying what you need. Alternatively use ` CondaPkg.add() ` to add dependencies from the
254+ REPL.
311255
312256## Writing packages which depend on PythonCall
313257
0 commit comments