Broken Repl After Uninstalling Some Extensions

Problem description:
I uninstalled some extensions that I no longer needed an now nix within my replit is broken.

Expected behavior:
I should be able to run the repl.

Actual behavior:
I can not run the repl and I get the following errors:

nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
         whose name attribute is located at /nix/store/x8dbrija74rnw16hrbw5r5apx9k81giz-nixpkgs-21.11-src/pkgs/stdenv/generic/make-derivation.nix:205:7

       … while evaluating attribute 'PYTHON_LD_LIBRARY_PATH' of derivation 'nix-shell'

         at /home/runner/Booogle-Revise-2/replit.nix:9:5:

            8|   env = {
            9|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
             |     ^
           10|       pkgs.rapidfuzz-cpp

       error: attribute 'rapidfuzz-cpp' missing

       at /home/runner/Booogle-Revise-2/replit.nix:10:7:

            9|     PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
           10|       pkgs.rapidfuzz-cpp
             |       ^
           11|

--> poetry add requests fun
/home/runner/Booogle-Revise-2/venv/bin/python3: line 3: exec: : not found
exit status 127

And

Traceback (most recent call last):
  File "main.py", line 3, in <module>
    from fun import login,gen_id,make_dict_group,user_data_group,username,recommend,rule_id,gen_code,leaderboard_dict,similarity,userinfo,make_dict,mod,play_dict,smart,last_7,week_add,stats_dict,update,make_dict_folder,subject,make_dict_rules
  File "/home/runner/Booogle-Revise-2/fun.py", line 4, in <module>
    from booogle_ai_tools.moderation import moderation
  File "/home/runner/Booogle-Revise-2/booogle_ai_tools/moderation/moderation.py", line 3, in <module>
    from sklearn.feature_extraction.text import CountVectorizer
  File "/home/runner/Booogle-Revise-2/venv/lib/python3.8/site-packages/sklearn/__init__.py", line 82, in <module>
    from .base import clone
  File "/home/runner/Booogle-Revise-2/venv/lib/python3.8/site-packages/sklearn/base.py", line 17, in <module>
    from .utils import _IS_32BIT
  File "/home/runner/Booogle-Revise-2/venv/lib/python3.8/site-packages/sklearn/utils/__init__.py", line 17, in <module>
    from scipy.sparse import issparse
  File "/home/runner/Booogle-Revise-2/venv/lib/python3.8/site-packages/scipy/sparse/__init__.py", line 267, in <module>
    from ._csr import *
  File "/home/runner/Booogle-Revise-2/venv/lib/python3.8/site-packages/scipy/sparse/_csr.py", line 10, in <module>
    from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory


Steps to reproduce:
Fork this repl: https://replit.com/@GoodVessel92551/Booogle-Revise-2

Bug appears at this link:
Repl link: https://replit.com/@GoodVessel92551/Booogle-Revise-2

Browser: Chrome
OS: Windows
Device (Android, iOS, NA leave blank): NA
Desktop app version (Avatar menu->“Version”) or NA: NA
Plan (Free, Replit Core): Free

Hello,
you should say what extensions you uninstalled in case others have the same problem.

Though I don’t know much about extensions, I forked your repl to do some debugging and developed a solution to make your repl work.


Try the solution on a fork of the repl first to make sure the changes will work.
Open the .replit file. underneath the [nix] section, change the value of channel to "stable-23_05". Then, delete the [interpreter] and [interpreter.command] sections and their contents. Next, insert the line disableGuessImports = true near the top of the file, such as underneath the hidden variable. This will prevent replit from auto-installing an unrelated fun package.
If you had tried to use your repl or the python interpreter now, you would find that, for some reason, importing math will give an error. math is a builtin module, so I wasn’t sure what to do. I opted for a sledgehammer solution: you will change the interpreter from python 3.8 to 3.9. You could probably instead change to 3.10 or 3.11, but 3.9 should minimize the things that have to be changed and updated.
Open the replit.nix file. Replace 8 with a 9 in three different places. In the .replit file, change 8 to a 9 in one place, at PYTHONPATH. Then, in the shell, run:

mv venv/lib/python3.8 venv/lib/python3.9

Now, open pyproject.toml file, and under [tool.poetry.dependencies] in the python variable, change the <3.9 to <3.10 . Then, either delete the sklearn variable or run poetry remove sklearn in the shell.
There are still some places that your repl says 3.8 instead of 3.9, but they probably won’t affect anything.
Many packages are now outdated because of the changed python version. Run poetry update in the shell (this will take a while to complete).
This is as far as I could go. Running your repl only gives scikit-learn warnings, they were probably there before things broke. You can disable all warnings by going into .replit file and changing the value of run to "python3 -Wi main.py".
You’ll probably have to change a bit of code to match the newly updated packages. Fix all the errors, and then once things work, you can apply all of these changes to your original repl.

2 Likes

Thank You! This worked the extensions that I uninstalled were (This might not of been all of them):

  • repl.tv
  • svg editor
  • visual .replit editor
  • Icon Generator

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