Module Error in Arithmetic Formatter Test (Scientific Computing with Python Module)

Hello FreeCodeCamp Support Team,

I hope this message finds you well. I am writing to bring to your attention an issue I have encountered while working on the Arithmetic Formatter project provided by FreeCodeCamp.

In the provided starter pack for the Arithmetic Formatter project, I have noticed that there is a module error when attempting to run the test module. Specifically, the error message states that the “pytest” module is not available. This error prevents me from successfully testing the code, as it crashes whenever I attempt to run the tests.

I understand the importance of thorough testing in the development process, and I believe that resolving this module error is crucial to ensuring the correctness of the project’s implementation. However, since the pytest module is not included in the starter pack, I am unable to execute the tests as intended.

I kindly request your assistance in resolving this issue. It would be greatly appreciated if you could either provide guidance on how to address this module error or update the starter pack to include the necessary dependencies, such as pytest, to facilitate the testing process.

Thank you for your attention to this matter. I am eager to continue working on the Arithmetic Formatter project and would greatly appreciate any assistance or guidance you can provide to resolve this module error.

Best regards,

You can find the Shell command prompt and type pip install pytest to install that module.

This might happen with other missing modules as well, pandas or seaborn etc. same fix, pip install pandas

1 Like

In Replit, you usually don’t need to use pip install to add modules or packages because Replit automatically install them through the import statements in your code.Which was already in the starter pack given by the free code camp, I also tried installing it through pip install but the result is same can you help me with it,
Thank you

I’d be happy to take a look, can you link to your replit?

When you did pip install pytest did anything happen? Did it install or it returned an error?

1 Like

I was able to fork your code and install pytest, it all worked ok:

 /nix/store/zqk3m21442kvpjwd3rh41wdavqkzkyik-python3-wrapper/bin/python3 $file
Traceback (most recent call last):
  File "/home/runner/guduguntlamanikkr-arithmetic-formatter-1/", line 1, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'
exit status 1

~/guduguntlamanikkr-arithmetic-formatter-1$ pip install pytest
Looking in indexes:
Collecting pytest
  Downloading (324 kB)
     |████████████████████████████████| 324 kB 9.0 MB/s 
Installing collected packages: tomli, pluggy, packaging, iniconfig, exceptiongroup, pytest
Successfully installed exceptiongroup iniconfig packaging pluggy pytest tomli

/nix/store/zqk3m21442kvpjwd3rh41wdavqkzkyik-python3-wrapper/bin/python3 $file
   32      3801      45      123
+ 698    -    2    + 43    +  49
-----    ------    ----    -----
...[test_two_problems_with_solutions] PASSED          [ 90%][test_five_problems_with_solutions] PASSED         [100%]

================================= 10 passed in 0.11s ==================================

Thank you so much, I was able to download the package and run the code thanks for your help appreciated.

1 Like

Thank you! I was having the same error and I thought this worked but not as I expected, I tried with others solutions but nothing happened, the thing is I still having this (I could not select “use run command” at the beginning , it was not that option) so I will create a help post:

run = “python3”
sh: line 1: run: command not found
exit status 127

1 Like

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