# Modern Fortran Manual Installation Error

**URL:** <https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506>\
**Category:** Visual Studio Code\
**Created:** [October 11, 2022, 6:48am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506 "2022-10-11T06:48:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 11, 2022, 6:48am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/1 "2022-10-11T06:48:45Z")

</div>

Hello everyone,

I am trying to install on my company pc the Modern Fortran extension but if I try to do so I end up with the following error:

" [“Invalid: Corrupt ZIP: end of central directory record signature not found”," at G.downloadExtension (vscode-file://vscode-app/c:/Software/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:195231)“,” at async G.doRun (vscode-file://vscode-app/c:/Software/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:194173)"] "

Since this might be due to the firewalls in place in the pc (although other extensions are installed without a problem), I tried to install it manually. I downloaded the "fortran-lang.linter-gfortran-3.2.0 " file and then I installed it from VSIX as instructed by VS code. However, I find the same error.

Does anyone have any suggestion or explaination on why it is doing so?

Thanks a lot,  
Giulio

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 11, 2022, 12:25pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/2 "2022-10-11T12:25:39Z")

</div>

what version of VS Code are you using? It sounds like you need to update VS Code, you need version 1.63.0+. Unfortunately, VS Code does not offer an elegant way to display version incompatibility, so it ends up printing cryptic errors.

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 11, 2022, 12:40pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/3 "2022-10-11T12:40:06Z")

</div>

I have version 1.72.0, which i think is the latest one.

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 11, 2022, 12:58pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/4 "2022-10-11T12:58:58Z")

</div>

Can you try and install cpptools [C++ programming with Visual Studio Code](https://code.visualstudio.com/docs/languages/cpp) and see if that is possible

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 11, 2022, 1:04pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/5 "2022-10-11T13:04:56Z")

</div>

I tried directly from VS code and gave me the same error. Then, I did it manually and it was fine, so now i have c++.

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 11, 2022, 1:06pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/6 "2022-10-11T13:06:45Z")

</div>

So it is probably your security options. Try and install the Modern Fortran extension now the same way from a local vsix. I suspect it was failing before because it was unable to fetch the C++ extension which we depend on for debugging.

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 12, 2022, 7:23am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/7 "2022-10-12T07:23:48Z")

</div>

Yes indeed now i was able to install Modern Fortran. However now the c++ extension gives the following two errors:

_Missing binary at … .vscode\extensions\ms-vscode.cpptools-1.12.4\bin\cpptools.exe_

It says that it is not possible to launch the server, therefore the intellisense functionalities are disabilitated.

_The C++ extension installed does not correspond to the system_

(I am translating so sorry if it is not clear)

In any case i tried to move the path to which extensions are installed since the problem migth be running some executables, and to do so in this computer without issues i need to have it in a particular folder.

I tried to use the following command:

> code --extensions-dir C:\Software\VS\_extension

But what it did was to open a new vs code window and create a misterious _extension_ file. If the i try to install extension it does not follow the directory written above.

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 12, 2022, 8:39am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/8 "2022-10-12T08:39:12Z")

</div>

You don’t need `cpptools.exe` to use the Modern Fortran extension, you only need some of its functionality when you are debugging.

At any rate, maybe the following will help resolve your issue.  
The cpptools does a bunch of stuff online so that could be why it’s failing. I don’t think it lack of permissions and cpptools.exe should be present in an offline installation, so I would suggest you reinstall:

- Uninstall Modern Fortran and cpptools.
- Go into the directory where extensions are installed, that would be the thing you quoted above `… .vscode\extensions`
- Delete any residual folders by the name `fortran-lang.linter-gfortran...` and `ms-vscode.cpptools...`
- Download a fresh copy from the Marketplace for your OS for [cpptools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools), see `Version History`. This should come with `cpptools.exe` preinstalled. You can check yourself after the download by looking into the vsix file, it’s just a compressed folder.
- Download a fresh copy from the Marketplace for your OS for [Modern Fortran](https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran), see `Version History`

If that fails might need to speak with your IT department to help you resolve this.

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 12, 2022, 12:43pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/9 "2022-10-12T12:43:03Z")

</div>

Ok thank you very much!

Just one last thing. Since i also need to install fortls is there a way to bypass the pip installation? I tried doing the

> pip install fortls

command but i think the security is blocking it. I tried to download the _forls.tar.gz_ file but from there the instructions i found on the internet are not very clear. If you have any solution to this problem it would be very appreciated. Thank you in any case for your availability!!

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 12, 2022, 1:20pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/10 "2022-10-12T13:20:09Z")

</div>

You can do a few things:

- Clone the github repo [GitHub - gnikit/fortls: fortls - Fortran Language Server](https://github.com/gnikit/fortls.git) and `pip instal -e .` from within the cloned repo
- Download the source or built distributions [fortls · PyPI](https://pypi.org/project/fortls/#files) and install that with pip

You will have to disable autoupdating since it will interfere with your firewall settings. For more please read the [Configuration options - fortls](https://gnikit.github.io/fortls/options.html) documentation.

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 13, 2022, 6:45am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/11 "2022-10-13T06:45:07Z")

</div>

Thank you! I was able to install fortls however vs code deosn’t seem to aknowledge it. I used the command

> “fortran.fortls.path”: “c:/software/winpython/wpy64-3850/python-3.8.5.amd64/lib/site-packages”

where i got the path by using `pip show fortls`, which gave back:

> Name: fortls  
> Version: 2.13.0  
> Summary: fortls - Fortran Language Server  
> Home-page: [https://gnikit.github.io/fortls](https://gnikit.github.io/fortls)  
> Author: Giannis Nikiteas  
> Author-email: [giannis.nikiteas@gmail.com](mailto:giannis.nikiteas@gmail.com)  
> License: MIT  
> Location: c:\software\winpython\wpy64-3850\python-3.8.5.amd64\lib\site-packages  
> Requires: json5, packaging  
> Required-by:

Do you know why is this the case? (I also tried adding `/fortls` to the path but to no good)

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 13, 2022, 11:02am UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/12 "2022-10-13T11:02:20Z")

</div>

Unfortunately `pip show` will show you the installation location of the Python library not where the binary i.e. `fortls` is installed. In a command prompt you can type

```nohighlight
where fortls

```

or in a Shell terminal

```nohighlight
which fortls

```

and that will give you the path you need to use.

In general, most times you can make a safe bet that that binaries are installed close to where the python module is installed in a folder called `bin`. So if you start snooping around `c:\software\winpython\wpy64-3850\python-3.8.5.amd64\` (maybe some directories up) you will find it).

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 13, 2022, 1:24pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/13 "2022-10-13T13:24:50Z")

</div>

Ok i did so! Now i have the following error:

> Error launching fortls: Please check that all selected options are supported by your language server version.

What could it be?

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 13, 2022, 1:39pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/14 "2022-10-13T13:39:28Z")

</div>

There should be a log message in the Output\>Modern Fortran channel attached to that.

If you haven’t input any custom settings I would guess that the location shows py `pip show fortls` needs to be appended to your `PYTHONPATH` variable. That’s not exclusive to `fortls` any Python program that you try to run and the lib/ location is not part of your PYTHONPATH will fail because it won’t be able to resolve the relative imports of the package.

---

<div class="post-metadata">

**Author:** ![OnlyGiulio](https://avatars.discourse-cdn.com/v4/letter/o/e9c0ed/32.png) [@OnlyGiulio](https://fortran-lang.discourse.group/u/OnlyGiulio)\
**Post date:** [October 13, 2022, 2:03pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/15 "2022-10-13T14:03:01Z")

</div>

Looking into the output i find:

> [2022-10-13 15:56:03.175] [renderer1] [warning] Settings pattern “keyboard.\*” doesn’t match any settings
> 
> [2022-10-13 15:56:05.184] [renderer1] [error] [Extension Host] (node:17204) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
> 
> (Use `Code --trace-deprecation ...` to show where the warning was created)
> 
> [2022-10-13 15:56:05.249] [renderer1] [warning] Settings pattern “keyboard.\*” doesn’t match any settings
> 
> [2022-10-13 15:56:06.516] [renderer1] [warning] Settings pattern “keyboard.\*” doesn’t match any settings
> 
> [2022-10-13 15:56:10.271] [renderer1] [warning] Settings pattern “keyboard.\*” doesn’t match any settings

How do i add the fortls program to the pythonpath variable?

By the way thank you so much for your patience and for the advices!

---

<div class="post-metadata">

**Author:** ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)\
**Post date:** [October 13, 2022, 2:42pm UTC](https://fortran-lang.discourse.group/t/modern-fortran-manual-installation-error/4506/16 "2022-10-13T14:42:44Z")

</div>

Try this

> <https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-so-it-finds-my-modules-packages>
