# Error building SymPy and PyCall when username has a space

**URL:** <https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214>\
**Category:** New to Julia\
**Tags:** question, python, installation, conda\
**Created:** [December 6, 2023, 11:44am UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214 "2023-12-06T11:44:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjslc008](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@cjslc008](https://discourse.julialang.org/u/cjslc008)\
**Post date:** [December 6, 2023, 11:44am UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/1 "2023-12-06T11:44:33Z")

</div>

Hi  
I’m trying to use SymPy and PyCall,but there is an error of a bad installation to both of them.When I use the the command Pkg.build ,it says that there is an error of precompilation as Miniconda doesn’t support the directories with a space.I’m using my microsoft user,that is Name Surname and that’s the reason why Miniconda doesn’t work.How can i solve it?  
julia\> Pkg.build(“PyCall”)  
Building Conda ─→ `C:\Users\Name Surname\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\51cab8e982c5b598eea9c8ceaced4b58d9dd37c9\build.log`  
Building PyCall → `C:\Users\Name Surname\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\1cb97fa63a3629c6d892af4f76fcc4ad8191837c\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: Conda.jl cannot be installed to its default location C:\Usuarios\Name Surname\Miniconda3  
as Miniconda does not support the installation to a directory with a space or a  
non-ASCII character on Windows. The work-around is to install Miniconda to a  
user-writable directory by setting the CONDA\_JL\_HOME environment variable. For  
example on Windows:

ENV[“CONDA\_JL\_HOME”] = raw"C:\Conda-Julia\3"  
using Pkg  
Pkg.build(“Conda”)

The Julia session need to be restarted. More information is available at  
[GitHub - JuliaPy/Conda.jl: Conda managing Julia binary dependencies](https://github.com/JuliaPy/Conda.jl).

Stacktrace:  
[1] error(s::String)  
@ Base .\error.jl:35  
[2] \_install\_conda(env::String, force::Bool)  
@ Conda C:\Users\Name Surname.julia\packages\Conda\sDjAP\src\Conda.jl:274  
[3] \_install\_conda(env::String)  
@ Conda C:\Users\Name Surname.julia\packages\Conda\sDjAP\src\Conda.jl:270  
[4] runconda(args::Cmd, env::String)  
@ Conda C:\Users\Name Surname.julia\packages\Conda\sDjAP\src\Conda.jl:180  
[5] add(pkg::String, env::String; channel::String, satisfied\_skip\_solve::Bool, args::Cmd)  
@ Conda C:\Users\Name Surname.julia\packages\Conda\sDjAP\src\Conda.jl:343  
[6] add  
@ C:\Users\Name Surname.julia\packages\Conda\sDjAP\src\Conda.jl:326 [inlined]  
[7] top-level scope  
@ C:\Users\Name Surname.julia\packages\PyCall\KLzIO\deps\build.jl:79  
[8] include(fname::String)  
@ Base.MainInclude .\client.jl:478  
[9] top-level scope  
@ none:5  
in expression starting at C:\Users\Name Surname.julia\packages\PyCall\KLzIO\deps\build.jl:43  
Stacktrace:  
[1] pkgerror(msg::String)  
@ Pkg.Types C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:69  
[2] (::Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1158  
[3] withenv(::Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{String, String}, ::Vararg{Pair{String}})  
@ Base .\env.jl:197  
[4] (::Pkg.Operations.var"#117#122"{String, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec})()  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1825  
[5] with\_temp\_env(fn::Pkg.Operations.var"#117#122"{String, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec}, temp\_env::String)  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1706  
[6] (::Pkg.Operations.var"#115#120"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1795  
[7] mktempdir(fn::Pkg.Operations.var"#115#120"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)  
@ Base.Filesystem .\file.jl:762  
[8] mktempdir(fn::Function, parent::String)  
@ Base.Filesystem .\file.jl:758  
[9] mktempdir  
@ .\file.jl:758 [inlined]  
[10] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target\_path::String, sandbox\_path::String, sandbox\_project\_override::Pkg.Types.Project; preferences::Dict{String, Any}, force\_latest\_compatible\_version::Bool, allow\_earlier\_backwards\_compatible\_versions::Bool, allow\_reresolve::Bool)  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1753  
[11] build\_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1139  
[12] build\_versions  
@ C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:1054 [inlined]  
[13] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)  
@ Pkg.Operations C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Operations.jl:996  
[14] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})  
@ Pkg.API C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:1053  
[15] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})  
@ Pkg.API C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:156  
[16] build(pkgs::Vector{Pkg.Types.PackageSpec})  
@ Pkg.API C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:145  
[17] #build#85  
@ C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:144 [inlined]  
[18] build  
@ C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:144 [inlined]  
[19] #build#84  
@ C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:143 [inlined]  
[20] build(pkg::String)  
@ Pkg.API C:\Users\Name Surname\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:143  
[21] top-level scope  
@ REPL[5]:1

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 6, 2023, 1:07pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/2 "2023-12-06T13:07:47Z")

</div>

Try to set JULIA\_DEPOT\_PATH to a directory with a proper name that exists and where you have write permissions. See: [Environment Variables · The Julia Language](https://docs.julialang.org/en/v1/manual/environment-variables/)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 6, 2023, 3:20pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/3 "2023-12-06T15:20:45Z")

</div>

> [@cjslc008](#):
>
> as Miniconda does not support the installation to a directory with a space or a  
> non-ASCII character on Windows.

This is a known limitation of Miniconda ([installation failled with accent in user name · Issue #199 · JuliaPy/Conda.jl · GitHub](https://github.com/JuliaPy/Conda.jl/issues/199)) that we can’t do much about.

You can install your own Python distribution into a different directory and tell PyCall about it when you build PyCall via `ENV["PYTHON"]`, or you can continue to use Conda.jl but tell it to install into a different directory by setting `ENV["CONDA_JL_HOME"]` before building.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [December 6, 2023, 8:16pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/4 "2023-12-06T20:16:20Z")

</div>

I mean, you post contains the answer:

> [@cjslc008](#):
>
> ERROR: LoadError: [Conda.jl](https://juliahub.com/ui/Packages/Conda) cannot be installed to its default location C:\Usuarios\Name Surname\Miniconda3  
> as Miniconda does not support the installation to a directory with a space or a  
> non-ASCII character on Windows. The work-around is to install Miniconda to a  
> user-writable directory by setting the CONDA\_JL\_HOME environment variable. For  
> example on Windows:
> 
> ENV[“CONDA\_JL\_HOME”] = raw"C:\Conda-Julia\3"  
> using Pkg  
> Pkg.build(“Conda”)
> 
> The Julia session need to be restarted. More information is available at  
> [GitHub - JuliaPy/Conda.jl: Conda managing Julia binary dependencies](https://github.com/JuliaPy/Conda.jl).

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [December 6, 2023, 8:43pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/5 "2023-12-06T20:43:30Z")

</div>

Is it better with:

> **[GitHub - jverzani/SymPyPythonCall.jl: SymPy with PythonCall backend (not PyCall)](https://github.com/jverzani/SymPyPythonCall.jl)**
>
> SymPy with PythonCall backend (not PyCall). Contribute to jverzani/SymPyPythonCall.jl development by creating an account on GitHub.

I believe it’s a drop-in replacement. You should in most cases use PythonCall, it’s very similar but not a drop-in replacement. It has a better API. It doesn’t use Conda per se, it uses micromamba, if I recall, a conda clone. You have access to all the same conda packages (and pip I understand too) and it helps install dependencies for you.

You don’t need to know that for that packages depending on it, but it’s good to know, and also for all wrapping or just using Python packages.

At least I’m curious if it handles spaces.

---

<div class="post-metadata">

**Author:** ![j\_verzani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_verzani/32/8551_2.png) [@j\_verzani](https://discourse.julialang.org/u/j_verzani)\
**Post date:** [December 6, 2023, 8:50pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/6 "2023-12-06T20:50:30Z")

</div>

> [@Palli](#):
>
> I believe it’s a drop-in replacement.

This is supposed to be true with the latest version of `SymPy.jl`, as they now mostly share the same underlying codebase. Any big discrepancies would be of interest. Though one place where there may be issues would be running `SymPyPythonCall` within an `IJulia` session, as in my limited experience `PyCall` and `PythonCall` don’t like to be run in the same session.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [December 9, 2023, 7:04pm UTC](https://discourse.julialang.org/t/error-building-sympy-and-pycall-when-username-has-a-space/107214/7 "2023-12-09T19:04:36Z")

</div>

That should work too, see docs, and there, also preceding comments about not working):

> [@Creating an package (and eventually app) with Python dependencies](https://discourse.julialang.org/t/creating-an-package-and-eventually-app-with-python-dependencies/107317/4):
>
> I haven’t used together myself, just know about the issue and solution in the doc (why I wrote read carefully, didn’t it work?): To force PythonCall to use the same Python interpreter as PyCall, set the environment variable JULIA\_PYTHONCALL\_EXE to "@PyCall". Note that this will opt out of automatic dependency management using CondaPkg. Alternatively, to force PyCall to use the same interpreter as PythonCall, set the environment variable PYTHON to PythonCall.C.CTX.exe\_path and then Pkg.build("…
