Closed nil-is-lin closed 8 months ago
Can you show exactly what you did?
You should
ENV["PYTHON"]
appropriatelyusing PyCall
and check that PyCall.python
is the desired pythonpyimport("matplotlib")
and see whether it succeedsI believe the following screenshot can illustrate my problem.
julia> using PyCall
julia> PyCall.python "C:\Users\nil_l\.julia\conda\3\x86_64\python.exe"
julia> ENV["PYTHON"] "D:\Python\Python312\python.exe"
(@v1.9) pkg> build PyCall Building Conda ─→
C:\Users\nil_l\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\8c86e48c0db1564a1d49548d3515ced5d604c408\build.log
Building PyCall →C:\Users\nil_l\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\43d304ac6f0354755f1d60730ece8c499980f7ba\build.log
julia> PyCall.python "C:\Users\nil_l\.julia\conda\3\x86_64\python.exe"
You need to start a new session after building PyCall, if PyCall has already been loaded. That's why step 1 in my comment above was "Start a fresh Julia session".
It would also be helpful to see the contents of the build.log
file for PyCall.
You are right. I used the wrong process, every time I used PyCall to see if it changed, and then built again, so it didn't work.
I have upgrade the python to python 3.12.0. However, it can't find the package "matplotlib" install by pip, which works well for the old version of python(3.11.3). It should be the problem for new python version, I guess.
there is no error in the process "set ENV, build PyCall". It just cant change to the system-wide python.