# "Had trouble installing fortls, please install manually"

**URL:** <https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584>\
**Category:** Uncategorized\
**Created:** [April 15, 2023, 11:54pm UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584 "2023-04-15T23:54:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seme4ka008](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@seme4ka008](https://fortran-lang.discourse.group/u/seme4ka008)\
**Post date:** [April 15, 2023, 11:54pm UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/1 "2023-04-15T23:54:23Z")

</div>

Hi everyone,

I am new in fortran and i’m trying to get Modern Fortran in VScode to work. Have issue with “Had trouble installing fortls, please install manually”. I guess I downloaded fortls ( and findent for sure). I put path from the console in Language Server Fortran Path fortls box, but it doesn’t gave any result. Still “Had trouble installing fortls, please install manually”. Am I something missing?

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/0/071a0ba4c92055b10d23923ab0fc23f8200fd6ed.png)

---

<div class="post-metadata">

**Author:** ![seme4ka008](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@seme4ka008](https://fortran-lang.discourse.group/u/seme4ka008)\
**Post date:** [April 15, 2023, 10:47pm UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/2 "2023-04-15T22:47:21Z")

</div>

Hello everyone,  
(I am not English speaking, so I really appologise for possible mistakes).

I’m totally new in Fortran and I try to find an explanation how to run Modern Fortran for VS code. Specifically, I found it, but didn’t understand at all. The main problem for me is the installation of fortls.

I have the following error: “Had trouble installing fortls, please install manually”. At first I saw information that I should specify the correct path, but then I figured out that before troubles with path I should install so called pip, shouldn’t I? If yes, how and where? I tried to download all similar extensions for VS (pip manager, pip installer, Pypi assistant) and then entered “pip install fortls” (and similar commands) in terminal but it clearly didn’t change anything. Also I tried to find it via links, but it’s even more not understandable what I should download and in which order. All guides/forums I read implies that I already know how to download PyPi / pip, but I’m not.

To be honest I even don’t understand why Modern Fortran downloads c++ extension, but uses packages written on Python.

I would very appreciate if someone will explain me what exactly I should do to install fortls and get Modern Fortran to work. I spent already 4+ hours only on this, and don’t have any hope to deal with it on my own. I only had an experience with C# in VS, so all this things with downloading different packages to download different servers and extensions is very hard for me

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [April 16, 2023, 3:51am UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/3 "2023-04-16T03:51:20Z")

</div>

@seme4ka008 welcome to the forum! I moved both of your posts into the same thread, as it seems to be the same issue.

---

<div class="post-metadata">

**Author:** ![snano](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@snano](https://fortran-lang.discourse.group/u/snano)\
**Post date:** [April 16, 2023, 7:16am UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/5 "2023-04-16T07:16:44Z")

</div>

Hi @seme4ka008, welcome.

Please follow these steps mentioned on the Modern Fortran- VSCode page[Modern Fortran- Visual Studio](https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran)

Here are possible steps, which you should follow (copying text from the page mentioned above):

1. Allow for `fortls` to be automatically installed with `pip` or `Anaconda` and if the location where `fortls` is installed is not in your `PATH` point VS Code to the `fortls` location by setting

```auto
{
  "fortran.fortls.path": "/custom/path/to/fortls"
}

```

1. Linting: may be you can safely ignore if you are using gfortran.

By default, the linter used is `gfortran`, Intel’s `ifort` and Intel’s LLVM based compiler `ifx` are also supported. One can use a different linter compiler via the option

```auto
{
  "fortran.linter.compiler": "ifx/gfortran"
}

```

1. Debugging: The extension uses the debugger from Microsoft’s [C/C++ extension](https://github.com/Microsoft/vscode-cpptools) for Visual Studio Code. This allows this extension to use the full functionality of the C/C++ extension for debugging applications.

Therefore C/C++ extensions are necessary.

1. Formatting:

Two formatters are supported [`findent`](https://github.com/gnikit/findent-pypi) and [`fprettify`](https://github.com/pseewald/fprettify). Both of them can be installed with `pip` automatically through the extension.

The formatter is controlled by the user option

```auto
{
  "fortran.formatting.formatter": "findent" | "fprettify" | "Disabled"
}

```

In nutshell, you need to install ifortls and fprettify/findent though conda or pip.

**For fortls:**

> With `pip`
> 
> pip uninstall fortran-language-server  
> pip install fortls --upgrade
> 
> or with Anaconda
> 
> conda uninstall fortran-language-server  
> conda install -c conda-forge fortls

**for fprettify:**

```auto
pip install fprettify

conda install -c programfan fprettify

```

Hope this helps. Good luck!!

---

<div class="post-metadata">

**Author:** ![seme4ka008](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@seme4ka008](https://fortran-lang.discourse.group/u/seme4ka008)\
**Post date:** [April 16, 2023, 9:15am UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/6 "2023-04-16T09:15:12Z")

</div>

Thanks for the reply!

1. How exactly I should allow fortls be installed? I attached a screenshot of command console. Didn’t I install it?  
What about “fortran.fortls.path”: “/custom/path/to/fortls”. Where should I put it? (and where I should put all commands above?) Should I change it? And also I mentined that I put the path where fortls packages were installed to the Server Language Path fortls. Is it wrong?
2. Sorry, but didn’t understand. I’m trying to get Modern Fortran to work. He can not compile or what?
3. Ok
4. Following same screenshot I guess I installed findent. Did I miss something?  
Also installed fpretiffy but it didn’t fix anything.

Thank you in advance and sorry for probably silly questions

UPD: I think I’ve got everything except findent/fprettify. I have installed it and put the path from scripts folder to the settings, but VS still cann’t see findent/fprettify and don’t install it (error PIP: Error: spawn pip ENOENT). Do you know what the problem can be?

---

<div class="post-metadata">

**Author:** ![anoban](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anoban](https://fortran-lang.discourse.group/u/anoban)\
**Post date:** [April 17, 2023, 5:38am UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/7 "2023-04-17T05:38:31Z")

</div>

Take a look at [bug: findent not found even though it is installed and in path (even specified it manually in settings) · Issue #839 · fortran-lang/vscode-fortran-support · GitHub](https://github.com/fortran-lang/vscode-fortran-support/issues/839)

---

<div class="post-metadata">

**Author:** ![seme4ka008](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@seme4ka008](https://fortran-lang.discourse.group/u/seme4ka008)\
**Post date:** [April 19, 2023, 9:00pm UTC](https://fortran-lang.discourse.group/t/had-trouble-installing-fortls-please-install-manually/5584/8 "2023-04-19T21:00:37Z")

</div>

Ok, thank you!
