# How do I create a src folder for my environment?

**URL:** <https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133>\
**Category:** New to Julia\
**Tags:** vscode\
**Created:** [December 15, 2021, 10:34am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133 "2021-12-15T10:34:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [December 15, 2021, 10:34am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/1 "2021-12-15T10:34:26Z")

</div>

I created a new environment following these the steps in [4. Working with Environments · Pkg.jl](https://pkgdocs.julialang.org/v1.2/environments/)

After that I told VSCode to use that environment by moving to it using the Explorer in VSCode and using the VSCode command `Activate This Environment`.

So far so good. But I noticed there is no `src` folder in the new environment. Should I create one manually or am I missing something?

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [December 15, 2021, 10:40am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/2 "2021-12-15T10:40:41Z")

</div>

I suppose you are trying to develop a package since you are interested in having a `src` folder?  
Try looking at [5. Creating Packages · Pkg.jl](https://pkgdocs.julialang.org/v1.2/creating-packages/) on how to automate having a structured folder for development,

If you want even more control and customization on what to generate for your package/development environment, have a look at [GitHub - invenia/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/invenia/PkgTemplates.jl), but I’d say that the basic `generate` is plenty good for starting to explore

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [December 15, 2021, 11:16am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/3 "2021-12-15T11:16:42Z")

</div>

Thanks. Just right off the bat you have helped me. Actually I am not trying to develop a package. I just thought I would need a `src` folder because I have seen `src` folders elsewhere. But if I do not need a `src` folder where do I put my source files? Right in the environment folder? Could I still create a `src` folder as a subfolder of the project folder and put my source files there for better organization?

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [December 15, 2021, 11:26am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/4 "2021-12-15T11:26:19Z")

</div>

An environment is not really tied to any file/folder structure, you can also have your source files using a specific environment in a completely different folder and just activate the correct environment by pointing to it.  
You can create a src subfolder or simply put the source files in the folder of the environment (the environment is just specified by the `Project.toml`).

I would still suggest you to try and generate a package structure for your tests, it directly creates a source subfolder and allows you to then re-use your code when you think it is in a good state by just `using` it. On top of easing up an eventual publication of your experimentation for other people to use.

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [December 15, 2021, 11:42am UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/5 "2021-12-15T11:42:30Z")

</div>

You are right. Learning how to create packages is in my agenda. However, my previous attempts failed. I took note of the URL you recommended and will give it another try ASAP.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [December 15, 2021, 1:03pm UTC](https://discourse.julialang.org/t/how-do-i-create-a-src-folder-for-my-environment/73133/6 "2021-12-15T13:03:36Z")

</div>

You don’t _need_ to do anything.

When you start Julia it activates the default environment and you can start typing away at the REPL.

If you want to bring in some code you can include(“path/to/file”) and it will be as if you typed it all in.

I’ve been using Julia for years and only recently started using custom environments.

You can have a folder of your own packages without using the package template, just this works:

```julia
$ mkdir /tmp/pkgs
$ echo "module ModuleName1 end" > /tmp/pkgs/ModuleName1.jl
$ echo "module ModuleName2 end" > /tmp/pkgs/ModuleName2.jl
$ echo 'push!(LOAD_PATH, "/tmp/pkgs")' >> ~/.julia/config/startup.jl
$ julia -q
julia> using ModuleName2
[Info: Precompiling ModuleName2 [top-level]

```
