# Problem in addidng a package to new created package dependencies

**URL:** <https://discourse.julialang.org/t/problem-in-addidng-a-package-to-new-created-package-dependencies/51964>\
**Category:** Package Management\
**Tags:** pkg, development\
**Created:** [December 17, 2020, 8:51am UTC](https://discourse.julialang.org/t/problem-in-addidng-a-package-to-new-created-package-dependencies/51964 "2020-12-17T08:51:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amirrezz94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amirrezz94/32/19363_2.png) [@Amirrezz94](https://discourse.julialang.org/u/Amirrezz94)\
**Post date:** [December 17, 2020, 8:51am UTC](https://discourse.julialang.org/t/problem-in-addidng-a-package-to-new-created-package-dependencies/51964/1 "2020-12-17T08:51:52Z")

</div>

Hi all,

I recently created a package (for the first time!) and I have a problem with precompiling my package. When I try `using PkgMPC` in julia repl I get this warning about lack of being required packages in `PkgMPC` dependencies.

```julia
julia> using PkgMPC
[Info: Precompiling PkgMPC [aa087d6f-2020-4239-96b7-77f8d7e93fb8]
┌ Warning: Package PkgMPC does not have Plots in its dependencies:
│ - If you have PkgMPC checked out for development and have
│ added Plots as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with PkgMPC
└ Loading Plots into PkgMPC from project dependency, future warnings for PkgMPC are suppressed.

```

It will be recompiled using the packages I have in my main `Project.toml` at `.../.julia/environments/Project.toml` but I want to add these packages into `PkgMPC` dependencies.

I would appreciate if someone could help me on resolving this issue.

also in my source module I tried `import ***` where \*\*\* are the packages which are required for running PkgMPC.I even tried to use `Reexport` which failed again. This is what I wrote in `PkgMPC.jl`:

```julia
module PkgMPC

# Write your package code here.
import Plots
import CSV
import JuMP
import Ipopt
import DataFrames
import DifferentialEquations
import PlotlyJS

#=
using Reexport

@reexport using Plots
@reexport using CSV
@reexport using JuMP
@reexport using Ipopt
@reexport using DataFrames
@reexport using DifferentialEquations
@reexport using PlotlyJS
=#

#using Plots, CSV, JuMP, Ipopt, DataFrames, DifferentialEquations

include("Extra.jl")
include("main.jl")
include("NMPC.jl")
include("Plant.jl")

export **************

end

```

and this is where I have my package on GitHub:  
[https://github.com/Amirrezz94/PkgMPC.jl](https://github.com/Amirrezz94/PkgMPC.jl)

Thank you guys!

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 17, 2020, 8:55am UTC](https://discourse.julialang.org/t/problem-in-addidng-a-package-to-new-created-package-dependencies/51964/2 "2020-12-17T08:55:23Z")

</div>

The issue, as Julia tells you, is that you don’t have any dependence on Plots.jl etc. listed in your Project.toml.

Go to the root of your repo and start `julia --project=.`. Now use `] add Plots` etc. to add the dependencies to the package’s Project.toml. You basically need to add all packages that you want to `using` in your package.

---

<div class="post-metadata">

**Author:** ![Amirrezz94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amirrezz94/32/19363_2.png) [@Amirrezz94](https://discourse.julialang.org/u/Amirrezz94)\
**Post date:** [December 17, 2020, 9:04am UTC](https://discourse.julialang.org/t/problem-in-addidng-a-package-to-new-created-package-dependencies/51964/3 "2020-12-17T09:04:26Z")

</div>

That’s exactly what I was looking for!  
Thank you.
