Error in using PyPlot in JuliaPro

Can anyone tell me why the PyPlot doesn’t work even though I have installed PyPlot and PyCall ?
The version of my JuliaPro is 1.1.1.1.

Here is the error message:

julia> using PyPlot
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
ERROR: LoadError: LoadError: PyCall not properly installed. Please run Pkg.build(“PyCall”)
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] top-level scope at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\src\startup.jl:44 [inlined]
[3] top-level scope at .\none:0
[4] include at .\boot.jl:326 [inlined]
[5] include_relative(::Module, ::String) at .\loading.jl:1038
[6] include at .\sysimg.jl:29 [inlined]
[7] include(::String) at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\src\PyCall.jl:1
[8] top-level scope at none:0
[9] include at .\boot.jl:326 [inlined]
[10] include_relative(::Module, ::String) at .\loading.jl:1038
[11] include(::Module, ::String) at .\sysimg.jl:29
[12] top-level scope at none:2
[13] eval at .\boot.jl:328 [inlined]
[14] eval(::Expr) at .\client.jl:404
[15] top-level scope at .\none:3
in expression starting at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\src\startup.jl:41
in expression starting at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\src\PyCall.jl:41
ERROR: LoadError: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\compiled\v1.1\PyCall\GkzkC.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1197
[3] _require(::Base.PkgId) at .\loading.jl:960
[4] require(::Base.PkgId) at .\loading.jl:858
[5] require(::Module, ::Symbol) at .\loading.jl:853
[6] include at .\boot.jl:326 [inlined]
[7] include_relative(::Module, ::String) at .\loading.jl:1038
[8] include(::Module, ::String) at .\sysimg.jl:29
[9] top-level scope at none:2
[10] eval at .\boot.jl:328 [inlined]
[11] eval(::Expr) at .\client.jl:404
[12] top-level scope at .\none:3
in expression starting at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyPlot\cdCMF\src\PyPlot.jl:4
ERROR: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\compiled\v1.1\PyPlot\oatAj.ji.
Stacktrace:
[1] compilecache(::Base.PkgId, ::String) at .\loading.jl:1197
[2] _require(::Base.PkgId) at .\loading.jl:960
[3] require(::Base.PkgId) at .\loading.jl:858
[4] require(::Module, ::Symbol) at .\loading.jl:853`

`

Please read the error message carefully:

Thanks for your reply.

Certainly I had done it before, but it just raised another error, and that is why I felt confused, because I think I had installed the packages correctly.

Maybe it is related to the environment, but I can not understand why it happened. I wish you can help me out.

Here is the error message:

julia> Pkg.build(“PyCall”)
Building Conda ─→ C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\Conda\CpuvI\deps\b uild.log
Building PyCall → C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\ build.log
┌ Error: Error building PyCall:
│ ┌ Info: Using the Python distribution in the Conda package by default.
│ └ To use a different Python version, set ENV[“PYTHON”]=“pythoncommand” and re-run Pkg.build(“PyCall”).
│ ERROR: LoadError: IOError: could not spawn setenv('C:\Users\86139\AppData\Local\Temp\python.exe' 'C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\find_libpython.py' --list-all,[“USERDOMAIN_ROAMINGPROFILE=DESKTOP-F6AESQP”, “DISABLE_FALLBACK=true”, “HOMEPATH=\Users\86139”, “ProgramData=C:\ProgramData”, “ProgramW6432=C:\Program Files”, “PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL”, “NODE_ENV=production”, “SESSIONNAME=Console”, “GKS_USE_CAIRO_PNG=true”, “APPDATA=C:\Users\86139\AppData\Roaming”, “PUBLIC=C:\Users\Public”, “USERDOMAIN=DESKTOP-F6AESQP”, “OS=Windows_NT”, “PROCESSOR_REVISION=8e0a”, “PyCharm=D:\JetBrains\PyCharm 2018.3.5\bin;”, “TMP=C:\Users\86139\AppData\Local\Temp”, “JULIA_EDITOR="D:\JuliaPro-1.1.1.1\app-1.36.0\atom.exe" -a”, “ALLUSERSPROFILE=C:\ProgramData”, “Path=D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS\deps\usr\bin;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS\deps\usr\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Polyspace\R2019a\runtime\win64;D:\Polyspace\R2019a\bin;D:\Polyspace\R2019a\polyspace\bin;C:\Users\86139\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\86139\AppData\Local\Programs\Python\Python37;C:\Users\86139\AppData\Local\Microsoft\WindowsApps;C:\Users\86139\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\86139\AppData\Local\GitHubDesktop\bin;D:\JetBrains\PyCharm 2018.3.5\bin;;C:\Program Files\Java\jdk-12\bin;”, “COMPUTERNAME=DESKTOP-F6AESQP”, “GKSwstype=svg”, “JAVA_HOME=C:\Program Files\Java\jdk-12”, “USERNAME=86139”, “CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files”, “CommonProgramFiles=C:\Program Files\Common Files”, “CLASSPATH=.;C:\Program Files\Java\jdk-12\lib;C:\Program Files\Java\jdk-12\lib\tools.jar”, “USERPROFILE=C:\Users\86139”, “GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q”, “PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Users\86139\Documents\WindowsPowerShell\Modules;C:\Program Files
(x86)\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules”,
“PROCESSOR_LEVEL=6”, “JULIA_PKG_TOKEN_PATH=C:\Users\86139\.juliapro\token.toml”, “=C:=C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps”, “TERM=xterm-256color”, “SystemDrive=C:”, “HOMEDRIVE=C:”, “TEMP=C:\Users\86139\AppData\Local\Temp”, “PYTHONIOENCODING=UTF-8”, “NODE_PATH=D:\JuliaPro-1.1.1.1\app-1.36.0\resources\app.asar\exports”, “LOCALAPPDATA=C:\Users\86139\AppData\Local”, “PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel”, “DriverData=C:\Windows\System32\Drivers\DriverData”, “NUMBER_OF_PROCESSORS=8”, “ComSpec=C:\Windows\system32\cmd.exe”, “SystemRoot=C:\Windows”, “JULIA_PKG_SERVER=https://pkg.juliacomputing.com/”, “OneDrive=C:\Users\86139\OneDrive - CUHK-ShenZhen”, “GKS_FILEPATH=C:\Users\86139\AppData\Local\Temp\jl_AAA0.tmp.png”, “JULIA_NUM_THREADS=4”, “ProgramFiles(x86)=C:\Program Files (x86)”, “GRDIR=C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\GR\jmltz\src\…\deps\gr”, “PSExecutionPolicyPreference=Bypass”, “JUNORC_PATH=D:\JuliaPro-1.1.1.1\.atom”, “GKS_FONTPATH=C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\GR\jmltz\src\…\deps\gr”, “LOGONSERVER=\\DESKTOP-F6AESQP”, “windir=C:\Windows”, “OneDriveCommercial=C:\Users\86139\OneDrive - CUHK-ShenZhen”, “ATOM_HOME=D:\JuliaPro-1.1.1.1\.atom”, “JULIA_LOAD_PATH=@;C:\Users\86139\AppData\Local\Temp\jl_12D2.tmp”, “CommonProgramW6432=C:\Program Files\Common Files”, “ProgramFiles=C:\Program Files”, “PROCESSOR_ARCHITECTURE=AMD64”, “OPENBLAS_MAIN_FREE=1”]): no such file or directory (ENOENT)
│ Stacktrace:
│ [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at .\process.jl:400
│ [2] #505 at .\process.jl:413 [inlined]
│ [3] setup_stdios(::getfield(Base, Symbol(“##505#506”)){Cmd}, ::Array{Any,1}) at .\process.jl:497
│ [4] _spawn at .\process.jl:412 [inlined]
│ [5] #eachline#511(::Bool, ::Function, ::Cmd) at .\process.jl:618
│ [6] eachline at .\process.jl:617 [inlined]
│ [7] #readlines#288 at .\io.jl:414 [inlined]
│ [8] readlines at .\io.jl:414 [inlined]
│ [9] exec_find_libpython at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:28 [inlined]
│ [10] #find_libpython#3(::typeof(Libdl.dlopen), ::Function, ::String) at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:43
│ [11] find_libpython(::String) at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:41
│ [12] top-level scope at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\build.jl:87
│ [13] include at .\boot.jl:326 [inlined]
│ [14] include_relative(::Module, ::String) at .\loading.jl:1038
│ [15] include(::Module, ::String) at .\sysimg.jl:29
│ [16] include(::String) at .\client.jl:403
│ [17] top-level scope at none:0
│ in expression starting at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\build.jl:43
└ @ Pkg.Operations C:\Users\julia\AppData\Local\Julia-1.1.1\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1138

It looks like it cannot start the Python executable, but I am not familiar enough with Windows to help further. Perhaps someone will have a suggestion.

C:\Users\86139\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\86139\AppData\Local\Programs\Python\Python37;

Apart from Conda, looks like you have a different Python installation in above paths, can you try using this Python installation to setup PyCall? You can do this by setting ENV[“PYTHON”] = <FULL_PATH_TO_PYTHON.EXE> and running Pkg.build(“PyCall”). I’m not sure why the Python that’s shipped with Conda.jl is not working for you (Maybe a conflict with your Python installation?)

Thanks for your reply.

I have tried setting path as mentioned, but it still doesn’t work, which seemingly indicates that Julia can not find my path.

Here is the error message:

julia> ENV[“PYTHON”] = “C:\\Users\\86139\\AppData\\Local\\Programs\\Python\\Python37”
“C:\\Users\\86139\\AppData\\Local\\Programs\\Python\\Python37”

julia> Pkg.build(“PyCall”)
Building Conda ─→ C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\Conda\CpuvI\deps\bu ild.log
Building PyCall → C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\b uild.log
┌ Error: Error building PyCall:
│ ┌ Info: No system-wide Python was found; got the following error:
│ │ Base.IOError(“could not spawn setenv('C:\\\\Users\\\\86139\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python37' -c \"import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'))\",["USERDOMAIN_ROAMINGPROFILE=DESKTOP-F6AESQP", "DISABLE_FALLBACK=true", "HOMEPATH=\\Users\\86139", "ProgramData=C:\\ProgramData", "ProgramW6432=C:\\Program Files", "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL", "NODE_ENV=production", "SESSIONNAME=Console", "APPDATA=C:\\Users\\86139\\AppData\\Roaming", "PUBLIC=C:\\Users\\Public", "USERDOMAIN=DESKTOP-F6AESQP", "OS=Windows_NT", "PROCESSOR_REVISION=8e0a", "PyCharm=D:\\JetBrains\\PyCharm 2018.3.5\\bin;", "TMP=C:\\Users\\86139\\AppData\\Local\\Temp", "JULIA_EDITOR=\"D:\\JuliaPro-1.1.1.1\\app-1.36.0\\atom.exe\" -a", "ALLUSERSPROFILE=C:\\ProgramData", "Path=D:\\JuliaPro-1.1.1.1\\Julia-1.1.1\\share\\julia\\stdlib\\v1.1\\MbedTLS;D:\\JuliaPro-1.1.1.1\\Julia-1.1.1\\share\\julia\\stdlib\\v1.1\\MbedTLS\\deps\\usr\\bin;D:\\JuliaPro-1.1.1.1\\Julia-1.1.1\\share\\julia\\stdlib\\v1.1\\MbedTLS;D:\\JuliaPro-1.1.1.1\\Julia-1.1.1\\share\\julia\\stdlib\\v1.1\\MbedTLS\\deps\\usr\\bin;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;D:\\Polyspace\\R2019a\\runtime\\win64;D:\\Polyspace\\R2019a\\bin;D:\\Polyspace\\R2019a\\polyspace\\bin;C:\\Users\\86139\\AppData\\Local\\Programs\\Python\\Python37\\Scripts;C:\\Users\\86139\\AppData\\Local\\Programs\\Python\\Python37;C:\\Users\\86139\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\86139\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\86139\\AppData\\Local\\GitHubDesktop\\bin;D:\\JetBrains\\PyCharm 2018.3.5\\bin;;C:\\Program Files\\Java\\jdk-12\\bin;", "COMPUTERNAME=DESKTOP-F6AESQP", "JAVA_HOME=C:\\Program Files\\Java\\jdk-12", "USERNAME=86139", "CommonProgramFiles(x86)=C:\\Program Files (x86)\\Common Files", "CommonProgramFiles=C:\\Program Files\\Common Files", "CLASSPATH=.;C:\\Program Files\\Java\\jdk-12\\lib;C:\\Program Files\\Java\\jdk-12\\lib\\tools.jar", "USERPROFILE=C:\\Users\\86139", "GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q", "PSModulePath=C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Users\\86139\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files (x86)\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules", "PROCESSOR_LEVEL=6", "python=C:\\\\Users\\\\86139\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python37", "JULIA_PKG_TOKEN_PATH=C:\\Users\\86139\\.juliapro\\token.toml", "=C:=C:\\Users\\86139\\.juliapro\\JuliaPro_v1.1.1.1\\packages\\PyCall\\ttONZ\\deps", "TERM=xterm-256color", "SystemDrive=C:", "HOMEDRIVE=C:", "TEMP=C:\\Users\\86139\\AppData\\Local\\Temp", "PYTHONIOENCODING=UTF-8", "NODE_PATH=D:\\JuliaPro-1.1.1.1\\app-1.36.0\\resources\\app.asar\\exports", "LOCALAPPDATA=C:\\Users\\86139\\AppData\\Local", "PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel", "DriverData=C:\\Windows\\System32\\Drivers\\DriverData", "NUMBER_OF_PROCESSORS=8", "ComSpec=C:\\Windows\\system32\\cmd.exe", "SystemRoot=C:\\Windows", "JULIA_PKG_SERVER=https://pkg.juliacomputing.com/\”, "OneDrive=C:\\Users\\86139\\OneDrive - CUHK-ShenZhen", "ProgramFiles(x86)=C:\\Program Files (x86)", "JULIA_NUM_THREADS=4", "PSExecutionPolicyPreference=Bypass", "JUNORC_PATH=D:\\JuliaPro-1.1.1.1\\.atom", "LOGONSERVER=\\\\DESKTOP-F6AESQP", "windir=C:\\Windows", "OneDriveCommercial=C:\\Users\\86139\\OneDrive - CUHK-ShenZhen", "ATOM_HOME=D:\\JuliaPro-1.1.1.1\\.atom", "JULIA_LOAD_PATH=@;C:\\Users\\86139\\AppData\\Local\\Temp\\jl_568B.tmp", "CommonProgramW6432=C:\\Program Files\\Common Files", "ProgramFiles=C:\\Program Files", "PROCESSOR_ARCHITECTURE=AMD64", "OPENBLAS_MAIN_FREE=1"]): no such file or directory (ENOENT)“, -4058)
│ └ using the Python distribution in the Conda package
│ ERROR: LoadError: IOError: could not spawn setenv('C:\Users\86139\AppData\Local\Temp\python.exe' 'C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\find_libpython.py' --list-all,[“USERDOMAIN_ROAMINGPROFILE=DESKTOP-F6AESQP”, “DISABLE_FALLBACK=true”, “HOMEPATH=\Users\86139”, “ProgramData=C:\ProgramData”, “ProgramW6432=C:\Program Files”, “PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL”, “NODE_ENV=production”, “SESSIONNAME=Console”, “APPDATA=C:\Users\86139\AppData\Roaming”, “PUBLIC=C:\Users\Public”, “USERDOMAIN=DESKTOP-F6AESQP”, “OS=Windows_NT”, “PROCESSOR_REVISION=8e0a”, “PyCharm=D:\JetBrains\PyCharm 2018.3.5\bin;”, “TMP=C:\Users\86139\AppData\Local\Temp”, “JULIA_EDITOR="D:\JuliaPro-1.1.1.1\app-1.36.0\atom.exe" -a”, “ALLUSERSPROFILE=C:\ProgramData”, “Path=D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS\deps\usr\bin;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS;D:\JuliaPro-1.1.1.1\Julia-1.1.1\share\julia\stdlib\v1.1\MbedTLS\deps\usr\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Polyspace\R2019a\runtime\win64;D:\Polyspace\R2019a\bin;D:\Polyspace\R2019a\polyspace\bin;C:\Users\86139\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\86139\AppData\Local\Programs\Python\Python37;C:\Users\86139\AppData\Local\Microsoft\WindowsApps;C:\Users\86139\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\86139\AppData\Local\GitHubDesktop\bin;D:\JetBrains\PyCharm 2018.3.5\bin;;C:\Program Files\Java\jdk-12\bin;”, “COMPUTERNAME=DESKTOP-F6AESQP”, “JAVA_HOME=C:\Program Files\Java\jdk-12”, “USERNAME=86139”, “CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files”, “CommonProgramFiles=C:\Program Files\Common Files”, “CLASSPATH=.;C:\Program Files\Java\jdk-12\lib;C:\Program Files\Java\jdk-12\lib\tools.jar”, “USERPROFILE=C:\Users\86139”, “GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q”, “PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Users\86139\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules”, “PROCESSOR_LEVEL=6”, “python=C:\\Users\\86139\\AppData\\Local\\Programs\\Python\\Python37”, “JULIA_PKG_TOKEN_PATH=C:\Users\86139\.juliapro\token.toml”,
“=C:=C:\Users\86139\.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps”, “TERM=xterm-256color”, “SystemDrive=C:”, “HOMEDRIVE=C:”, “TEMP=C:\Users\86139\AppData\Local\Temp”, “PYTHONIOENCODING=UTF-8”, “NODE_PATH=D:\JuliaPro-1.1.1.1\app-1.36.0\resources\app.asar\exports”, “LOCALAPPDATA=C:\Users\86139\AppData\Local”, “PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel”, “DriverData=C:\Windows\System32\Drivers\DriverData”, “NUMBER_OF_PROCESSORS=8”, “ComSpec=C:\Windows\system32\cmd.exe”, “SystemRoot=C:\Windows”, “JULIA_PKG_SERVER=https://pkg.juliacomputing.com/”, “OneDrive=C:\Users\86139\OneDrive - CUHK-ShenZhen”, “ProgramFiles(x86)=C:\Program Files (x86)”, “JULIA_NUM_THREADS=4”, “PSExecutionPolicyPreference=Bypass”, “JUNORC_PATH=D:\JuliaPro-1.1.1.1\.atom”, “LOGONSERVER=\\DESKTOP-F6AESQP”, “windir=C:\Windows”, “OneDriveCommercial=C:\Users\86139\OneDrive -
CUHK-ShenZhen”, “ATOM_HOME=D:\JuliaPro-1.1.1.1\.atom”, “JULIA_LOAD_PATH=@;C:\Users\86139\AppData\Local\Temp\jl_568B.tmp”, “CommonProgramW6432=C:\Program Files\Common Files”, “ProgramFiles=C:\Program Files”, “PROCESSOR_ARCHITECTURE=AMD64”, “OPENBLAS_MAIN_FREE=1”]): no
such file or directory (ENOENT)
│ Stacktrace:
│ [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at .\process.jl:400
│ [2] #505 at .\process.jl:413 [inlined]
│ [3] setup_stdios(::getfield(Base, Symbol(”##505#506")){Cmd}, ::Array{Any,1}) at .\process.jl:497
│ [4] _spawn at .\process.jl:412 [inlined]
│ [5] #eachline#511(::Bool, ::Function, ::Cmd) at .\process.jl:618
│ [6] eachline at .\process.jl:617 [inlined]
│ [7] #readlines#288 at .\io.jl:414 [inlined]
│ [8] readlines at .\io.jl:414 [inlined]
│ [9] exec_find_libpython at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:28 [inlined]
│ [10] #find_libpython#3(::typeof(Libdl.dlopen), ::Function, ::String) at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:43
│ [11] find_libpython(::String) at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\buildutils.jl:41
│ [12] top-level scope at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\build.jl:87
│ [13] include at .\boot.jl:326 [inlined]
│ [14] include_relative(::Module, ::String) at .\loading.jl:1038
│ [15] include(::Module, ::String) at .\sysimg.jl:29
│ [16] include(::String) at .\client.jl:403
│ [17] top-level scope at none:0
│ in expression starting at C:\Users\86139.juliapro\JuliaPro_v1.1.1.1\packages\PyCall\ttONZ\deps\build.jl:43
└ @ Pkg.Operations C:\Users\julia\AppData\Local\Julia-1.1.1\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1138

looks like there are too many \\ so it couldn’t find Python, try C:/Users/... or raw"C:\Users\...?

Also your ENV have some sensitive information, you should edit it out.

1 Like

Thanks for your reminder.

I did checked all forms of path, but they all gave birth to the same results, even I use the form corresponding to the error message (just what you have seen).

Maybe I should try reinstalling my JuliaPro.

julia> ENV[“PYTHON”] = “C:\Users\86139\AppData\Local\Programs\Python\Python37”

Above path is incorrect, ENV[“PYTHON”] should contain full path to python.exe binary and not a folder.

Example:- ENV["PYTHON"] = "C:\\Python37-x64\\python.exe"

You can refer to following documentation for more details: GitHub - JuliaPy/PyCall.jl: Package to call Python functions from the Julia language

2 Likes

Thanks a lot!

I tried to search it in official documentation, but I failed. Your reference indeed helps me a lot!

A similar problem was reported here: https://github.com/JuliaPy/PyCall.jl/issues/688

Somehow, for some Windows users, Conda is getting installed in AppData\Local\Temp directory. Try doing

rm(joinpath(first(DEPOT_PATH), "conda", "deps.jl"))

to delete the stored preferences for Conda.jl followed by running

add Conda
build Conda
build PyCall

at the pkg> prompt.

If someone could shed light on why JuliaPro on Windows is installing Conda into the AppData\Local\Temp directory, that would be much appreciated.

Thanks for your reply.

Unfortunately, the terminal still reports the same error if I set

ENV[“PYTHON”]=“”

I had the same situation and I’ll share here my learnings. First of it all, I’m more in the “fans” side of Julia, (as opposite to expert) so my comments may not be expressed in pure wording.

Conceptually I believe PyPlot, with its core functionality available from Python get’s connected to Julia by using PyCall. When doing the typical Pkg.add(“PyPlot”) in Julia, Julia needs a way to re-build PyPlot and PyCall. The issue rises in PyCall, as that’s the one “talking” to the core functionalities of Matplotlib created in Python, so the build process needs Python. All troubles I has was related to the build process not being able to “find” Python in my machine. I tried Python 3.8 and I couldn’t make it work as the file where Python is installed gets a really restrictive access policy. The same does not happen to 3.7, so I moved back to 3.7. Once there I made sure the file where Phyton.exe is available where added to the Windows PATH. and in the ENV[“PYTHON”] =“python.exe”, as the rest for finding python is the the PATH System Variable. During the trial -error process with Python 3.8 , and enabling som debugging options prompted in the error mesagge it was clear the error was by not allowing Python.3.8.exe or the other required dlls to be accessed, and I couldn’t change that in my Windows (I as runing admin priv, but it was complettely locked).

Well…Once I adjusted to 3.7 , and the PATH and the ENV[“PYTHON”], the Pkg.build(“PyCall”)
worked ok, but when tried to issue the “using PyPlot” a new error came up. In fact i had to re -instal matplotlib now in Python 3.7 by using the console and the "python -m pip install -U pip
python -m pip install -U matplotlib "… There the PyPlot–>PyCall–>Matplotlib chain was complette and the package finally ran ok. I’m sure there sould be a way with Python 3.8, but I didn’t find it. Hope this helps