Python Replit Run Button Issue

Tell us what’s happening:
Describe your issue in detail here.
I had this issue and noticed a few other posts in project specific threads, so I thought it may be helpful for others to be able to see this here.

Today when importing the polygon area calculator project in Replit, from GitHub, the default for the run button in Replit was being set to “python venv/lib/python3.8/site-packages/distlib/index.py” This was causing an error when the run button was clicked, see below. Manually changing the run button to “python test_module.py” achieved the expected results as experienced in previous replit python projects from FreeCodeCamp.

python venv/lib/python3.8/site-packages/distlib/index.py
Traceback (most recent call last):
  File "venv/lib/python3.8/site-packages/distlib/index.py", line 18, in <module>
    from . import DistlibException
ImportError: attempted relative import with no known parent package
exit status 1

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: Scientific Computing with Python Projects - Polygon Area Calculator

Link to the challenge:

The file to run should be main.py, the test module is imported there

How did you manually changed the run button to "python test_module.py” ?

follow the steps in this post, and set main.py as file to execute

you can also manually execute any file writing in the shell python file_name

1 Like

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