What is the "$HOME/.ecmwfapirc" file? And how to create it?
Asked
Active
Viewed 2,124 times
-1

jonrsharpe
- 115,751
- 26
- 228
- 437

Ajar
- 29
- 5
-
It's file named `.ecmwfapirc` in your home directory. You can create it however you like - depending on platform `touch ~/.ecmwfapirc` may suffice. – jonrsharpe Feb 14 '17 at 20:10
-
@jonrsharpe I tried creating the file using notepad in the home directory ( the same path as mentioned in the error). What I am doing wrong? – Ajar Feb 14 '17 at 20:27
-
I have added the python error as well! – Ajar Feb 14 '17 at 20:34
-
1. Then why are you asking about the file? It's trying to get the key and URL from environment variables. 2. Include code and error messages **as text**, with correct, formatting, not as images. – jonrsharpe Feb 14 '17 at 20:35
-
I asked about the file, because I think its because of that file that the code is making an error. And the code is only of two lines: `from ecmwfapi import ECMWFDataServer` the error is as follows: `ImportError Traceback (most recent call last)
in – Ajar Feb 22 '17 at 18:37() ----> 1 from ecmwfapi import ECMWFDataServer ImportError: cannot import name 'ECMWFDataServer'`
2 Answers
2
I'm not sure if you're still struggling with this, but I think you might have a problem with the name of your file. It should read exactly ".ecmwfapirc", without an extension and including the dot (it means your file is hidden to the system).
You can create it with Notepad, but then you'd have to remove the extension. For example from the command window. Be sure you have this file under your User
directory and be aware that you need to run the script from a Unix system.
2
If you're on Windows, $HOME is your user directory, so it's telling you should create this file there.
Example: C:/Users/YOUR_USER/
This file MUST be named .ecmwfapirc
, to do so, open cmd, go to your user directory and type echo > .ecmwfapirc
.

Pedro Amaral Reis
- 21
- 3