# Julia present working directory

**URL:** https://discourse.julialang.org/t/julia-present-working-directory/89164
**Category:** New to Julia
**Created:** [October 23, 2022, 10:37pm UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164 "2022-10-23T22:37:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Muhammad\_Nadeem](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Muhammad\_Nadeem](https://discourse.julialang.org/u/Muhammad_Nadeem)
#### Post date: [October 23, 2022, 10:37pm UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164/1 "2022-10-23T22:37:32Z")

</div>

Hello all,

I am bit confused in working directory of Julia. So if suppose i am working in “test” folder then the working directory of Julia should be “test” i-e if i write pwd() in Julia then it should give me the test folder? Also both “Project.toml” and “Manifest.toml” should be in the same (test) folder?

Thanks,

---

<div class="post-metadata">

### Author: ![magister-ludi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magister-ludi/32/4003_2.png) [@magister-ludi](https://discourse.julialang.org/u/magister-ludi)
#### Post date: [October 24, 2022, 1:47am UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164/2 "2022-10-24T01:47:25Z")

</div>

> [@Muhammad\_Nadeem](#):
>
> suppose i am working in “test” folder

It would be useful if you can say why you think you are ‘working in’ the folder? To work in a particular folder, I would do one of two things:

1. Start Julia from that folder (if you are in Windows, the `/` need to be `\`):

```julia
> cd /path/to/my/folder
> julia

```

1. Run Julia, then set the folder (in this case, you can use `/` in Windows, too):

```julia
> julia
julia> cd("/path/to/my/folder")

```

Two questions: What did you do to set the ‘working’ folder?What do you get when you enter `pwd()`?

> [@Muhammad\_Nadeem](#):
>
> Also both “Project.toml” and “Manifest.toml” should be in the same (test) folder?

Is `test` a subfolder of a project? If it is, there should be `Project.toml` and `Manifest.toml` in the folder above. There **can** be `Project.toml` and `Manifest.toml` in the `test` folder, but there often isn’t.

---

<div class="post-metadata">

### Author: ![Muhammad\_Nadeem](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Muhammad\_Nadeem](https://discourse.julialang.org/u/Muhammad_Nadeem)
#### Post date: [October 24, 2022, 3:32am UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164/3 "2022-10-24T03:32:09Z")

</div>

Thank you so much for the detailed response. Actually I am working in a main folder called “Project” then there are sub folders of this namely “src” and “test”. In the main project folder i have `Project.toml` and `Manifest.toml` files, in the test folder i have these files too. Now what should i consider my working directory/environment when I am working on a file in “test” folder? should it be the main “Project” folder or the subfolder “test”. Also when i am working in a “test” folder and trying to call a module in “src” folder it give me an error and it says that module is not in the current path? For example see the following code

using Test

using question1

using Random

include(“test\_lmcp.jl”)

Now i am running a code in a ‘test’ folder and my working environment in Julia is main “Project” folder and “question1” is a module in ‘src’ folder, when i try to run this code it gives me this error

_ArgumentError: Package question1 not found in current path._  
_- Run `import Pkg; Pkg.add("question1")` to install the question1 package._

Now I dont know whats wrong here? which path should i be working in, it is bit confusing to me.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [October 24, 2022, 3:42am UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164/4 "2022-10-24T03:42:08Z")

</div>

I suggest NOT to use the test folder as active folder. Always navigate to the project folder and start julia with

```julia
julia --project

```

To activate the test environment use the package [GitHub - JuliaTesting/TestEnv.jl: Activate your test enviroment, so you can use your test dependencies in the REPL](https://github.com/JuliaTesting/TestEnv.jl)

---

<div class="post-metadata">

### Author: ![magister-ludi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magister-ludi/32/4003_2.png) [@magister-ludi](https://discourse.julialang.org/u/magister-ludi)
#### Post date: [October 24, 2022, 6:12am UTC](https://discourse.julialang.org/t/julia-present-working-directory/89164/5 "2022-10-24T06:12:49Z")

</div>

I agree with @ufechner7 , it’s best to work in the top-level folder, and to work in a local environment using `--project`. If the top level is **not** package `question1`, you might need to do what the error message tells you, and add the package to **that** environment.

I have never used [TestEnv.jl](https://github.com/JuliaTesting/TestEnv.jl), but it looks like it could help you.
