# Pkg.clone command not being recognized

**URL:** https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391
**Category:** New to Julia
**Created:** [June 22, 2021, 6:04pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391 "2021-06-22T18:04:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)
#### Post date: [June 22, 2021, 6:04pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/1 "2021-06-22T18:04:11Z")

</div>

I was trying to install the [HiddenMarkovModel.jl](https://github.com/ahwillia/HiddenMarkovModel.jl) package. It is not registered, so the link instructs me to use the `clone` command. But I am getting this strange error about this command not being valid.

```julia
julia> Pkg.clone("https://github.com/ahwillia/HiddenMarkovModel.jl")
ERROR: UndefVarError: clone not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at .\Base.jl:26
 [2] top-level scope at REPL[5]:1

```

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [June 22, 2021, 6:12pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/2 "2021-06-22T18:12:43Z")

</div>

The instructions are outdated, and you should use `Pkg.add`. Note that the first sentence in the README says

> **Note:** There is now a registered package [HiddenMarkovModels.jl](https://github.com/BenConnault/HiddenMarkovModels.jl). This package is no longer maintained (but it still works).

So I suggest you use that instead.

---

<div class="post-metadata">

### Author: ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)
#### Post date: [June 22, 2021, 6:32pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/3 "2021-06-22T18:32:10Z")

</div>

Actually there was another problem with the HiddenMarkovModels.jl package, which I reported [here](https://discourse.julialang.org/t/problem-with-installing-installing-hiddenmarkovmodels-jl/63390).

I used the `add` command but get a different error now

```julia
julia> Pkg.add(url="https://github.com/ahwillia/HiddenMarkovModel.jl")
    Cloning git-repo `https://github.com/ahwillia/HiddenMarkovModel.jl`
   Updating git-repo `https://github.com/ahwillia/HiddenMarkovModel.jl`
ERROR: could not find project file in package at `https://github.com/ahwillia/HiddenMarkovModel.jl` maybe `subdir` needs to be specified
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:52
 [2] resolve_projectfile!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec, ::String) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:672
 [3] (::Pkg.Types.var"#49#50"{Pkg.Types.Context,Pkg.Types.PackageSpec})(::LibGit2.GitRepo) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:645
 [4] with(::Pkg.Types.var"#49#50"{Pkg.Types.Context,Pkg.Types.PackageSpec}, ::LibGit2.GitRepo) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LibGit2\src\types.jl:1128
 [5] handle_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:597
 [6] handle_repos_add!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Types.jl:663
 [7] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:168
 [8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:139
 [9] #add#21 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [10] add at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [11] #add#19 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65 [inlined]
 [12] add at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65 [inlined]
 [13] add(; name::Nothing, uuid::Nothing, version::Nothing, url::String, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:82
 [14] top-level scope at REPL[7]:1

```

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [June 22, 2021, 6:40pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/4 "2021-06-22T18:40:59Z")

</div>

The package is not maintained or actively developed – thus it is outdated and doesn’t work. It is missing the Project.toml file which was introduced for packages during I believe the Julia 1.0 transition. To add it in a newer version of Julia you need to update the package yourself.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [June 22, 2021, 7:33pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/5 "2021-06-22T19:33:56Z")

</div>

> [@iamsuddhasattwa](#):
>
> I used the `add` command but get a different error now

It was latest updated six years ago and the `REQUIRE` file mentions Julia 0.3 so you might have a chance to run it with Julia 0.3, but that version is ancient so there isn’t really much point today unless you want to pursue archaeology.

---

<div class="post-metadata">

### Author: ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)
#### Post date: [June 22, 2021, 8:53pm UTC](https://discourse.julialang.org/t/pkg-clone-command-not-being-recognized/63391/6 "2021-06-22T20:53:22Z")

</div>

I see.
