Problems in use symbolic math

I am trying to use SymPy package to deal with symbolic math. For example:

using SymPy
x, y, z = symbols("x y z")
z=(x^2+y^2)/(y^2+1);

However, the error appears:

x, y, z = symbols("x y z")
ERROR: ArgumentError: ref of NULL PyObject

Anyone can help me please?

1 Like

Working for me:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.0 (2020-08-01)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using SymPy

julia> x, y, z = symbols("x y z")
(x, y, z)

julia> z=(x^2+y^2)/(y^2+1)
 2    2
x  + y 
───────
  2    
 y  + 1

Perhaps your Python installation is broken?
Operating system?
Are you using Conda?

Citation:

To force Julia to use its own Python distribution, via Conda, simply set ENV["PYTHON"] to the empty string "" and re-run Pkg.build("PyCall") .

1 Like

I am with windows
Julia version 1.0.4
I re run Pkg.build(“PyCall”) but nothing yet!
Can I remove all packages and reinstall all?

We have updated but nothing work:

Did you execute:

before executing
Pkg.build("PyCall")

That is important.

Furthermore, if it is possible for you, install Julia 1.5 instead of 1.0.4 . It works much more smoothly.

2 Likes

Nothing yet…
See:


Could you help me please? Is the version 1.0.4?
I have afraid to other packages and many sintaxes change when I use the version 1.5.

It should be possible to run any code that works with 1.0.4 on 1.5.
But note that you can install version 1.5 at the same time as 1.0.4 and choose which version you want to run.

Version 1.5 has a lot of advantages, and packages (that are maintained) are probably more likely to work correctly.

2 Likes

Please execute:

ENV["PYTHON"]=""
Pkg.build("PyCall")

You did it in the wrong order.

2 Likes

Dear friend,
I did as you told me; installed version 1.5 and ran ENV[“PYTHON”]=“” and then Pkg.build(“PyCall”).
But nothing happens, it stays for hours “installing”.
Do you know what this could be, please?

Did you try first just adding and running the SymPy package?

Yes, but the error message appears: I don know how can I do…

Please try with Julia instead of JuliaPro

Yes, it can take a long amount of time.
But you can see the progress by looking at the logfile:
c:\Users\Usuario.julia\packages\PyCall\zqDXB\deps\build.log
I guess I spelled your user name wrong, it seams to have special characters in it.

Not sure how to look at a log file in windows, in linux you just do:
tail -f <logfilename>

Perhaps you can try to open the log file with your favorite editor.

Special chacters avoid anything?

I’ve installed all again. I’ll try to install now. Thank you so much

Dear friend, you are on time at this very stage
Nothing happens.

Are you using Atom?
Try to avoid that if you are debugging a problem, because it introduces addtional problems.

Did you:

  1. install Julia 1.5 from Download Julia
  2. on the julia command prompt entered
    ENV[“PYTHON”]=“”
3. entered the package manager by pressing ]
4. run the command "up" to update the list of  the packages
5. installed SymPy with the command
   add SymPy

Did any of these steps result in an error?

If yes, are you perhaps behind a firewall?

Furthermore, what is the output of the command
status
while you are in the package manager?

For me I have the output:
(@v1.5) pkg> status
Status `~/.julia/environments/v1.5/Project.toml`
  [6e4b80f9] BenchmarkTools v0.5.0
  [336ed68f] CSV v0.7.7
  [d749ddd5] DaemonMode v0.1.0 `https://github.com/dmolina/DaemonMode.jl#master`
  [a93c6f00] DataFrames v0.21.6
  [d330b81b] PyPlot v2.9.0
  [2db162a6] QML v0.6.0
  [24249f21] SymPy v1.0.27

(@v1.5) pkg> 
It will be different for you, but might be important to know.

Dear Friend,
I did all steps, all right.
Could you see for me please and the next step?

Now press backspace and then

julia> using SymPy

But you did not follow the instructions to download the standard version of Julia from the download page pointed to by @ufechner7. You are still using Julia Pro, which is a different version that most people here are not familiar with.

Ok I did this. See:


But when I run using SymPy look:

Julia say to run Pkg.build(“PyCall”) and never install…
Please help me!!