Christopher Rowley

Results 471 comments of Christopher Rowley

I'm guessing you did something like this? ``` julia> pyimport("sys").stdout = stdout Base.TTY(Base.Libc.WindowsRawSocket(0x0000000000000278) open, 0 bytes waiting) julia> @py begin import numpy as np a = np.zeros(10) print(a) end ERROR:...

Stuff printed by Python code to stdout/stderr should still appear no problem. Are you running in some other environment which redirects stdout, such as Jupyter?

Ok yeah in Jupyter the only solution I'm aware of is to override stdout. PythonCall used to do this for you but got removed - maybe it could be readded...

I agree it would be nice, and I've wondered the same in the past. However, suppose that Foo does something Pythonic in its `__init__` function (e.g. imports a Python module)....

Yeah it's a [known issue](https://juliapy.github.io/PythonCall.jl/stable/faq/#Heap-corruption-when-using-PyTorch). See also #215.

That issue suggested printing a warning if torch is loaded before juliacall, which was never implemented.

I can't reproduce this on my machine. Do you still have this issue? Does it occur if you do the import directly from Python (you can do `pkg> conda run...

Ah ok thanks, I need to make CondaPkg clear out any Python env vars.

Yep, you can do `delete!(ENV, "PYTHONHOME")` for example (it only affects the running process). CondaPkg already modifies other env vars.

It does, if you do `delete!(ENV, "PYTHONHOME")` from Julia then start Python from within Julia, it won't see PYTHONHOME.