Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The add packages lines cause a lot of problem #81

Closed
CaiYitao opened this issue Mar 10, 2021 · 9 comments
Closed

The add packages lines cause a lot of problem #81

CaiYitao opened this issue Mar 10, 2021 · 9 comments

Comments

@CaiYitao
Copy link

import Pkg
Pkg.activate(mktempdir())
Pkg.add([
Pkg.PackageSpec(name="Images", version="0.22.4"),
Pkg.PackageSpec(name="QuartzImageIO"),
Pkg.PackageSpec(name="PlutoUI", version="0.7"),
Pkg.PackageSpec(name="HypertextLiteral", version="0.5"),
Pkg.PackageSpec(name="ForwardDiff"),
Pkg.PackageSpec(name="NonlinearSolve"),
Pkg.PackageSpec(name="StaticArrays")
])

this cause a lot of problem, when opening the notebook every time it shows I need to add another packages, even though the packages do exists, these lines acutually does not add any packages to Julia, so it makes opening the notebook a pain.

Could you please do not add those lines in Notebook?

Thanks in advance

@dpsanders
Copy link
Collaborator

@YTCai: We need to add those lines so that everybody can use the notebook with the same versions of the packages, and for the online versions of the notebook.

You can open a notebook with a text editor to remove these lines from your local copy.

Which problems does it cause you?

@CaiYitao
Copy link
Author

1, When I open the notebook next time it requires me to add some new packages which is not listed in those lines. it works when opening at the first time and then problems arises after that.

2, after I delete those lines it requires to install packages which is already exists, but it said it is not in current path!

3, I have checked in Package REPL, like type "st", those packages are actually not added to Julia.
I have been using Pluto since Sept.2020 (fall 2020 computational thinking course) have not run into any such problem.
when adding packages, simpler lines like
using Pkg; Pkg.add(" Packages") works, but those complicated lines does not.

@CaiYitao
Copy link
Author

Thank you for prompt and kind reply, David, I love the course and learned a lot from you!

@fonsp
Copy link
Member

fonsp commented Mar 10, 2021

Julia has a global package installation cache. The command Pkg.add just add package specifications to your currently activated list of packages, packages are only downloaded and installed if that version has never been installed before.

So your points 2 and 3 are the intended behavior. I am not sure what you mean with 1, can you be more specific about:

it requires me to add some new packages which is not listed in those lines

What do you mean with:

  • it
  • some new packages
  • those lines

@CaiYitao
Copy link
Author

Hi Fons,
Thanks for your prompt reply.

For example:
The following are "those lines" ,

the first time is ok to use, but later when load the notebook it requires to add "QuartzImageIO" ( "some new packages")which it does not need when loading first time.

"It " means "notebook which have those lines".

import Pkg
Pkg.activate(mktempdir())
Pkg.add([
Pkg.PackageSpec(name="Images", version="0.22.4"),
Pkg.PackageSpec(name="ImageIO"),
Pkg.PackageSpec(name="PlutoUI", version="0.7"),
Pkg.PackageSpec(name="HypertextLiteral", version="0.5"),
Pkg.PackageSpec(name="ForwardDiff"),
Pkg.PackageSpec(name="NonlinearSolve"),
Pkg.PackageSpec(name="StaticArrays")
])

@fonsp
Copy link
Member

fonsp commented Mar 10, 2021

Hi @YTCai,

Did you work on the exercises already? Did you change the input image?

@CaiYitao
Copy link
Author

CaiYitao commented Mar 10, 2021 via email

@CaiYitao
Copy link
Author

CaiYitao commented Mar 10, 2021 via email

@fonsp
Copy link
Member

fonsp commented Mar 10, 2021

@YTCai Did you change the input image?

@fonsp fonsp closed this as completed Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants