Error when running the code (unable to read .replit:)

I’m working on some codes in Replit for the freeCodeCamp, and I’m facing some problems when trying to run the code to complete the last two projects.

When I hit the Run button, I got the following message:

unable to read .replit:
unable to decode .replit: toml: cannot load TOML value of type map[string]interface {} into a Go string

This error appears even without modifying anything in the file (starter code). It simply does not run any code in it.

Link to the challenge with the Replit starter code:
Data Analysis with Python Projects - Page View Time Series Visualizer | Learn | freeCodeCamp.org

Can anyone help me? Thanks!

Can you link your repl?

Thanks for replying!

I do not have my code on repl right now (I have imported the starter code again so I deleted the one with my code), but I can link you the repl starter code that return the same error:

boilerplate-page-view-time-series-visualizer - Python Repl - Replit

Even if you try to run it to fail the test (because it doesn’t have the code), it won’t even initialize. With the project code or not, the same message appears.

Thanks again!

Hi @lgrm thanks for the boilerplate Repl.

I looked at the Repl and was concerned that the .replit file contained very little information:

language = "python3"
run = "python main.py" 

[nix]

[nix.channel]
channel = "stable-22_05"

I created a separate empty Python Repl and copied in the .replit file contents, overwriting the above configuration. The Replit then ran.

Edit: Can you please confirm that you used Github import for the boilerplate and didn’t try to create the Repl from scratch? I think the issue is with how freeCodeCamp have set up their Repl.

2 Likes

Thanks for replying!

Yes, I imported directly from GitHub… It seems that the same error is showing up in the last two projects of the course (previous projects that are also in my Repl folder ran normally). I made a post on the freeCodeCamp forum but so far I haven’t gotten a response.

EDIT: I took a look at the file you commented and compared it with a previous project that ran, and there really is a huge difference in the code.

I copied and pasted it and ran it, it seems that the testing was activated. As I imported again, my code does not appear in the file, but in a few hours I will be on the computer that has my code and I will try to execute it, and then I will return here.

I noticed that the error message did not appear. The following appeared, but I think it is now a configuration issue, once I enter my code I’ll take a look at that too::

Traceback (most recent call last):
File “main.py”, line 2, in
import time_series_visualizer
File “/home/runner/boilerplate-page-view-time-series-visualizer/time_series_visualizer.py”, line 1, in
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named ‘matplotlib’

Looks like it will work!!

Thanks a lot for your attention!

1 Like

UPDATE: You nailed it! The .replit file was missing some info.

After I did the procedure of copying and pasting the code from the other project in the .replit file, I inserted my code, made some adjustments in the packager files and then it worked!

I had to tweak some other Python and package settings, but the initial problem was resolved thanks to your comment and observation. Thank you, IanAtReplit, thank you very much! :pray:

2 Likes

Hi @lgrm that’s fantastic news. Well done on working the problem out!

1 Like

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