Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error spawning fortls: Please check that fortran-language-server is installed and in your path. #42

Open
HCorte opened this issue Jan 3, 2022 · 1 comment

Comments

@HCorte
Copy link

HCorte commented Jan 3, 2022

keep getting the following error message in my project in VSC

image

have the path defined in settings.json:
"fortran-ls.executablePath": "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts",

and also in the XXXX.code-workspace the same:
"fortran-ls.executablePath": "C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts",

have the path in the evnironment variable PATH and also created a environment variable named fortls that its value is:
C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts

installed python so could use pip to install the fortran-language-server:
pip install fortran-language-server

the versions

python --version
Python 3.9.9

fortls --version
1.12.0

gfortran --version
GNU Fortran (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

is there any step/s that am missing?

@yumasheta
Copy link

yumasheta commented Jan 17, 2022

I just spend some time getting this to work on my linux machine. It should actually be enough to just set the fortran-ls.executablePath setting in any (even bound to the workspace) settings.json file.

I think the problem you have is that you have to provide the path to the executable itself, not just the containing folder.
So it'd be:

"fortran-ls.executablePath": "C:\\Users\\Username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts\\fortls"

Also, change your single backslashes to double, as stated under "Configuration" here: https://marketplace.visualstudio.com/items?itemName=hansec.fortran-ls

My problem was, that I didn't provide an absolute path in the settings, but relative to the workspace. That didn't work.
Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants