I get nix error with a simple code and don't know why

Question: I don’t understand why in my console I get this code?

https://replit.com/@kkwatanabe01/TEST-1?v=1

Welcome to Ask! This has something to do with the new Python template. If it bothers you, use the following steps:

  1. Click the three dots and “Show hidden files”
  2. Navigate to .replit
  3. Create a new line at the top (make this line 1) containing run = "clear && python3 main.py"
2 Likes

Thanks, where is the file .replit located? I don’t see it on my screen under files so just wondering where it is.

Screenshot 2023-09-21 at 7.23.01 PM

Ah you will have to click the 3 dots and show hidden files first. Then it will show up near the bottom. I’ve had the hidden files shown for so long in my settings that I overlooked that step. My apologies.

Ah ok! No worries! So I added the line, but it is still running the text.

Add it to the very beginning. Make it line 1.

1 Like

Amazing that worked! Thank you so much!

2 Likes

Hello @kkwatanabe01! I just want to chime in to explain why you see that output.
First, this is not a bug. That command is actually what gets run when you click the “run” button. The executable file you are running is:

/nix/store/zqk3m21442kvpjwd3rh41wdavqkzkyik-python3-wrapper/bin/python3 which is a file provided by the Python Nix module. As the name suggests, it’s a wrapper for the actual python executable. Which sets PYTHONPATH correctly and adds runtime libraries that allow popular python libraries like numpy or pandas to work out of the box. If you type in the shell which python3 you’ll find the same executable, which means if you type python3 main.py it will use that specific one!
So as you can see, the run button is doing the right thing!

Having said that, due to the confusion expressed by multiple users, we’ll hide the /nix/store/zqk3m21442kvpjwd3rh41wdavqkzkyik-python3-wrapper/bin part from the console from this week on.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.