Closed rarelygoeshere closed 1 year ago
No worries at all! CLI can be tough.
I've got two questions-
datasette
work for you if you don't include the --metadata
arg? metadata.json
and reddit.db
show up if you run the dir
command?Hello there, thanks for stopping by! Here are my answers to your questions:
Just out of curiosity, I typed datasette reddit.db --metadata metadata.json sans --metadata and the result obviously didn't do anything.
Hope these answers help your assessment!
Ah, cool.
So when you run CLI commands, they're run from a directory (known as the "current directory"). From your screenshots, it looks like you're in C:\Users\admin-pc
and then the root of your C:\
drive.
Datasette looks for the reddit.db
(and metadata.json
) in the directory you run the command from. So if the reddit.db
file isn't in C:\Users\admin-pc
, then you get the error you're seeing.
To fix this, you need to do 2 things:
reddit.db
file iscd
(change directory) command to navigate your terminal to where that file isOnce there, datasette
will work as expected. If you put metadata.json
in that folder as well, it'll get picked up automatically.
Does that make sense?
Ah, cool.
So when you run CLI commands, they're run from a directory (known as the "current directory"). From your screenshots, it looks like you're in
C:\Users\admin-pc
and then the root of yourC:\
drive.Datasette looks for the
reddit.db
(andmetadata.json
) in the directory you run the command from. So if thereddit.db
file isn't inC:\Users\admin-pc
, then you get the error you're seeing.To fix this, you need to do 2 things:
- Find where your
reddit.db
file is- use the
cd
(change directory) command to navigate your terminal to where that file isOnce there,
datasette
will work as expected. If you putmetadata.json
in that folder as well, it'll get picked up automatically.Does that make sense?
Ahh, I see, then. That makes sense. I'll do so right away. Edit: Oh wow! It worked! I did what you instructed, and it looks like everything is now in working order! All right! Im quite certain my datasette is now complete. Thank you kindly for your instructions, I really appreciate your help!
Awesome! Glad that worked out. I'll go ahead and close this, but I hope this has been illuminating 😅
Hello, I've recently come to be aware of this from your post on reddit, and I've been struggling with the final step of creating a metadata.json file, as I keep getting the error seen in file attached. Changing the txt file into .json seems easy enough, and copy pasting the content was too, yet when I ran datasette reddit.db --metadata metadata.json, it didn't work. I hope you might be able to help me understand this
Disclaimer: I'm very new to datasette and am a layman in general, with very few, if any, knowledge of CLI, so I hope you may excuse my ignorance on things. Thank you.