To use what you have locally, use develop rather than add:
help?> Pkg.develop
Pkg.develop(pkg::Union{String, Vector{String}}; io::IO=stderr)
Pkg.develop(pkgs::Union{Packagespec, Vector{Packagespec}}; io::IO=stderr)
Make a package available for development by tracking it by path. If pkg is
given with only a name or by a URL, the package will be downloaded to the
location specified by the environment variable JULIA_PKG_DEVDIR, with
.julia/dev as the default.
If pkg is given as a local path, the package at that path will be tracked.
Examples
≡≡≡≡≡≡≡≡≡≡
# By name
Pkg.develop("Example")
# By url
Pkg.develop(url="https://github.com/JuliaLang/Compat.jl")
# By path
Pkg.develop(path="MyJuliaPackages/Package.jl")
See also PackageSpec
using Pkg
Pkg.develop(path="path\\to\\file\\MyModule")
However the error is saying that the path to the module does not exist
You can check the directory exists with isdir:
isdir("path\\to\\file\\MyModule")
If that returns false, then there is most likely a typo in the path!
@pdeffebach
Excuse me, I just copied it plus my module name of ModuleClasses so the path will be "C:\\Users\\amroa\\OneDrive\\Desktop\\Test\\Classes\\ModuleClasses", @mmiller do you agree?
In Julia, a package is a folder, with a specific folder structure, not a file. Please read these docs to better understand. Your file ModuleClasses.jl needs to be in the src sub-folder of a folder titled ModuleClasses.
ERROR: Did not find a git repository at `C:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\16- Create Package\ModuleClasses
Is because Pkg.add looks for a git repository. If you do Pkg.develop instead, it will not do this and use the path supplied to the keyword argument.
Please try the below and see if it works!
Pkg.develop(path="C:\\Users\\amroa\\OneDrive - polymtl.ca\\AmroAlsabbagh\\Code\\Julia\\Tests and Notes\\16- Create Package\\ModuleClasses")