Skip to content

Commit 8d0ce84

Browse files
committed
added some docs for code loading edge case
1 parent 8b8ac73 commit 8d0ce84

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/src/pythoncall.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,19 @@ To add dependencies to a Julia package, just ensure the package project is activ
308308

309309
See the [CondaPkg.jl](https://github.com/JuliaPy/CondaPkg.jl) documentation.
310310

311+
!!! note
312+
If running from a script, make sure that [CondaPkg.jl](https://github.com/JuliaPy/CondaPkg.jl) is used before [PythonCall.jl](https://github.com/JuliaPy/PythonCall.jl) to ensure proper loading of Python packages in your path. E.g.,
313+
314+
```julia
315+
using CondaPkg
316+
317+
CondaPkg.add("numpy")
318+
319+
using PythonCall
320+
321+
np = pyimport("numpy")
322+
```
323+
311324
## Writing packages which depend on PythonCall
312325

313326
### Example

0 commit comments

Comments
 (0)