# Plot Vectors with CalculusWithJulia Package is not Working in JupyterNotebook

**URL:** <https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053>\
**Category:** General Usage\
**Tags:** jupyter, plotting\
**Created:** [July 31, 2022, 10:37am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053 "2022-07-31T10:37:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 31, 2022, 10:37am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/1 "2022-07-31T10:37:49Z")

</div>

Hi all,

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.

```julia
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’”,)

 ![Capture d’écran_2022-07-31_17-33-47](https://global.discourse-cdn.com/julialang/original/3X/1/9/198be273bf3cf7ffe76d42e7715c85493fbd28f9.png)  
 ![Capture d’écran_2022-07-31_17-34-03](https://global.discourse-cdn.com/julialang/original/3X/8/9/89b62d44a31982ad91d3e64da98bda5037e42340.png)

---

<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:** [July 31, 2022, 11:18am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/2 "2022-07-31T11:18:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 31, 2022, 11:55am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/3 "2022-07-31T11:55:32Z")

</div>

I check my version, it is the latest I think:

` [a2e0e22d] CalculusWithJulia v0.0.1`

I try to tweak to make it works. The creator of the package, great notes that you make on Calculus.

---

<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:** [July 31, 2022, 12:07pm UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/4 "2022-07-31T12:07:47Z")

</div>

No, that’s the first, the latest should be v0.0.22. Maybe `using Pkg; Pkg.update()` will help sort this out.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 31, 2022, 12:40pm UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/5 "2022-07-31T12:40:46Z")

</div>

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)

```julia
pip3 install sympy
which python3

```

`/usr/bin/python3`

In Julia REPL:

```julia
    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.

 ![Capture d’écran_2022-07-31_19-37-35](https://global.discourse-cdn.com/julialang/original/3X/f/b/fbede468114abd0c7a097a87eb6a377cccbe8f9d.png)

---

<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:** [July 31, 2022, 1:20pm UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/6 "2022-07-31T13:20:20Z")

</div>

Those extra steps should be unnecessary, as installing `SymPy` should pull in a working `sympy` library through the magic of `PyCall.jl` and `Conda.jl`.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 31, 2022, 1:36pm UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/7 "2022-07-31T13:36:33Z")

</div>

This is the failed upgrading of CalculusWithJulia:

 ![Capture d’écran_2022-07-31_20-35-51](https://global.discourse-cdn.com/julialang/original/3X/a/1/a1be44a5b36d700feeb1e1e98e8d56ac73a36c36.png)

---

<div class="post-metadata">

**Author:** ![Syx\_Pek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/syx_pek/32/6364_2.png) [@Syx\_Pek](https://discourse.julialang.org/u/Syx_Pek)\
**Post date:** [August 1, 2022, 5:35am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/8 "2022-08-01T05:35:01Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 1, 2022, 6:59am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/9 "2022-08-01T06:59:18Z")

</div>

What kind of other issues?

I will try it later then. Thanks

---

<div class="post-metadata">

**Author:** ![Syx\_Pek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/syx_pek/32/6364_2.png) [@Syx\_Pek](https://discourse.julialang.org/u/Syx_Pek)\
**Post date:** [August 1, 2022, 7:34am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/10 "2022-08-01T07:34:04Z")

</div>

I just remembered to mention two things:

1. 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.

2. 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.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 1, 2022, 10:42am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/11 "2022-08-01T10:42:12Z")

</div>

> [@Syx\_Pek](#):
>
> `add CalculusWithJulia@0.0.22`

Thanks @Syx_Pek for your guidance,  
I think it is very complicated the error message is very long:

 ![Capture d’écran_2022-08-01_17-41-16](https://global.discourse-cdn.com/julialang/original/3X/9/c/9c40be09a7410b0ab943f15e4f3b48fda0e3bab7.png)

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 1, 2022, 10:54am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/12 "2022-08-01T10:54:48Z")

</div>

I feel like I’m giving this answer about once a week on here, recently I also gave it on SO so now I’m linking to that:

[https://stackoverflow.com/questions/73054419/julia-unsatisfiable-requirements-detected-for-package-error-when-installing-mu/73068667#73068667](https://stackoverflow.com/questions/73054419/julia-unsatisfiable-requirements-detected-for-package-error-when-installing-mu/73068667#73068667)

TL;DR: don’t install packages in the default environment, work with project specific environments instead.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 2, 2022, 5:21am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/13 "2022-08-02T05:21:16Z")

</div>

If I were to work with Julia REPL then I can do:

```julia
] activate --temp
(then add the necessary packages)

```

But how about if I am to use Jupyter Notebook  
which code should I put before I open Jupyter Notebook, here how I usually open Jupyter:

```julia
julia

julia> using IJulia
julia> notebook()

```

So we shouldn’t use JuliaDB then.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 2, 2022, 7:33am UTC](https://discourse.julialang.org/t/plot-vectors-with-calculuswithjulia-package-is-not-working-in-jupyternotebook/85053/14 "2022-08-02T07:33:10Z")

</div>

As I said in the SO answer:

> 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](https://pkgdocs.julialang.org/v1/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).
