I am using CalculusWithJulia, it works and showing the plot of vectors addition when I use the REPL. But when I use Jupyter Notebook, it does not work.
I install the sympy by pip install sympy but it is not recognized by Jupyter Notebook.
using CalculusWithJulia
using Plots
gr() # better arrows than plotly()
quiver([0],[0], quiver=([1],[2]))
unzip(vs) = Tuple(eltype(first(vs))[xyz[j] for xyz in vs] for j in eachindex(first(vs)))
u = [1, 2]
v = [4, 2]
w = u + v
p = [0,0]
quiver(unzip([p])..., quiver=unzip([u]))
quiver!(unzip([u])..., quiver=unzip([v]))
quiver!(unzip([p])..., quiver=unzip([w]))
The error in Jupyter Notebook says:
ModuleNotFoundError(âNo module named âsympyââ,)
Iâm guessing that you have an old version of CalculusWithJulia being loaded, as it shouldnât need SymPy to be installed now. But, for this error, if updating doesnât work, try installing SymPy.
I am going to share to others who want to use CalculusWithJulia in the future.
I type this in terminal (I use Linux+Python3+Julia 1.7.3)
pip3 install sympy
which python3
/usr/bin/python3
In Julia REPL:
ENV["PYTHON"]="/usr/bin/python3"
using Pkg
Pkg.build("PyCall")
Then I am able to plot the vectors addition. I need this for Linear Algebra. Thanks for the suggestion, I have tried to update it but still stuck at this version, will try again later.
Can you try ]st to see all the packages you have in your project? It might be the case that another package is holding back the upgrading of the package.
Alternatively, one could try ]up to update all the packages in your project so as to update the blocking package as well as CalculusWithJulia.jl (this might lead to other issues, so be careful).
If you want to debug packages not upgrading, one could try ]add CalculusWithJulia@0.0.22 (in this case) and see the errors that had occurred.
The issues is sometimes in a development environment, there are other packages that you rely on with breaking updates. It is likely in the case of CalculusWithJulia, this is not the case, but in general for development, upgrading all the packages might cause your existing codebase to fail of which there are usually 2 choices: editing your existing to code to be compatible with the upgrade version of other packages, or just give up and rely on the older version of packages.
In short, make a new folder for whatever analysis youâre working on and do ] activate . in that folder to start a new environment to which you only add the specific packages needed for that analysis.
IJulia can parse Pkg REPL mode syntax, alternatively you can do using Pkg and then use the functional API.
JuliaDB was the specific issue that the OP on SO faced, so might not have anytthing to do with your problem. In general though itâs probably correct to say that JuliaDB shouldnât be used by most people at this point (unless and until a new maintainer for the package steps up).