# Created package is not defiened with using PkgTemplates

**URL:** https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934
**Category:** New to Julia
**Tags:** package, first-steps
**Created:** [November 29, 2020, 1:00pm UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934 "2020-11-29T13:00:24Z")
**Posts on this page:** 7
**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: [November 29, 2020, 1:00pm UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/1 "2020-11-29T13:00:24Z")

</div>

Hi,  
I tried to create a simple package using PkgTemplates package. I used this template on [invenia website](https://invenia.github.io/PkgTemplates.jl/stable/user/#A-More-Complicated-Example-1) to create my package:

```julia
t = Template(;
    user="Amirrezz94",
    dir="C:\\Users\\Amirr\\.julia\\dev",
    authors="Amir",
    julia=v"1.5.3",
    plugins=[
        License(; name="MIT"),
        Git(; manifest=true),
        GitHubActions(; x86=true),
        Codecov(),
        Documenter{GitHubActions}(),
    ],
)

```

and afterwards:

```julia
t("MyExample")

```

to update a repository on my GitHub with the same name and it worked successfully. But when I want to test the package on `runtest.jl` file, it says:

```julia
ArgumentError: Package MyExample not found in current path:
- Run `import Pkg; Pkg.add("MyExample")` to install the MyExample package.

require(::Module, ::Symbol) at loading.jl:893

```

I also tired `import Pkg; Pkg.add("MyExample")` which gave me the error:

```julia
SystemError: opening file "C:\\Users\\Amirr\\.julia\\registries\\General\\Registry.toml": No such file or directory

```

my `runtest.jl` file is like this:

```julia
using MyExample
using Test

@testset "MyExample.jl" begin
    # Write your tests here.

    my_f(2,1)
end

```

I followed [this video](https://www.youtube.com/watch?v=q-LV4zoxc-E) to create the package.  
I would appreciate if anyone could help me on this.

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [November 29, 2020, 1:20pm UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/2 "2020-11-29T13:20:32Z")

</div>

I thing you need to `Pkg.develop` the new package rather than adding it.

---

<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: [November 29, 2020, 2:07pm UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/3 "2020-11-29T14:07:09Z")

</div>

The result is the same and it cannot find `Registry.toml` file.  
I get the same error as before when I use `Pkg.develop("MyExample")`

```julia
SystemError: opening file "C:\\Users\\Amirr\\.julia\\registries\\General\\Registry.toml": No such file or directory.

```

I checked that path and it seems that I don’t have such file in my .julia folder (`Registry.toml`).

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [November 29, 2020, 5:58pm UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/4 "2020-11-29T17:58:27Z")

</div>

Hmm, it sounds like you need `Pkg.init()`, but I thought that was called automatically if it was required. Can you add and import other packages?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [December 1, 2020, 9:39am UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/5 "2020-12-01T09:39:29Z")

</div>

Yeah it looks like you have an issue with your registry in general? Do other package manager commands work?

---

<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 1, 2020, 9:56am UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/6 "2020-12-01T09:56:57Z")

</div>

I think you are following the general procedure for creating packages, but I wanted to do it through “PkgTemplates.jl”. And yes I can update/add/remove my other packages.

---

<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 1, 2020, 10:03am UTC](https://discourse.julialang.org/t/created-package-is-not-defiened-with-using-pkgtemplates/50934/7 "2020-12-01T10:03:47Z")

</div>

Yes package manager works for all the packages except the one I make with PkgTemplates.

I think it’s because of the fact that when I create a package, the `Project.toml` and `Manifest.toml` (which are located at `C:\Users\Amirr\.julia\environments\v1.5`) don’t get upadated and I cannot see the name of my package there, so, package manager doesn’t define my -new created- package.

this is the message I get when I create a package:

```julia
[ Info: Running prehooks
[ Info: Running hooks
 Activating environment at `C:\Users\Amirr\.julia\dev\FirstPkg\Project.toml`
   Updating registry at `C:\Users\Amirr\.julia\registries\General`
No Changes to `C:\Users\Amirr\.julia\dev\FirstPkg\Project.toml` 
No Changes to `C:\Users\Amirr\.julia\dev\FirstPkg\Manifest.toml`
 Activating environment at `C:\Users\Amirr\.julia\environments\v1.5\Project.toml`
 Activating new environment at `C:\Users\Amirr\.julia\dev\FirstPkg\docs\Project.toml`
  Resolving package versions...
Updating `C:\Users\Amirr\.julia\dev\FirstPkg\docs\Project.toml`
  [e30172f5] + Documenter v0.25.5
Updating `C:\Users\Amirr\.julia\dev\FirstPkg\docs\Manifest.toml`
  [ffbed154] + DocStringExtensions v0.8.3
  [e30172f5] + Documenter v0.25.5
  [b5f81e59] + IOCapture v0.1.1
  [682c06a0] + JSON v0.21.1
  [69de0a69] + Parsers v1.0.12
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
Path `..` exists and looks like the correct package. Using existing path.
  Resolving package versions...
Updating `C:\Users\Amirr\.julia\dev\FirstPkg\docs\Project.toml`
  [eb04945b] + FirstPkg v0.1.0 `..`
Updating `C:\Users\Amirr\.julia\dev\FirstPkg\docs\Manifest.toml`
  [eb04945b] + FirstPkg v0.1.0 `..`
 Activating environment at `C:\Users\Amirr\.julia\environments\v1.5\Project.toml`
[ Info: Running posthooks
[ Info: New package is at C:\Users\Amirr\.julia\dev\FirstPkg

```
