Replit Import Results in Error from Blank Repl

When I try to import Replit, it ends up with this error:

Traceback (most recent call last):
  File "/home/runner/WIP-WOTR/main.py", line 1, in <module>
    from replit import db
ModuleNotFoundError: No module named 'replit'
exit status 1

I tried downloading pip and installing it from there, but it still resulted in a different error.

What error did you get?

This is the full print from the shell.

Collecting replit
  Using cached replit-3.3.0-py3-none-any.whl (31 kB)
Collecting requests<3.0.0,>=2.25.1
  Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Collecting Werkzeug<3.0.0,>=2.0.0
  Using cached Werkzeug-2.3.6-py3-none-any.whl (242 kB)
Collecting aiohttp<4.0.0,>=3.6.2
  Using cached aiohttp-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting typing_extensions<4.0.0,>=3.7.4
  Using cached typing_extensions-3.10.0.2-py3-none-any.whl
Collecting pyseto<2.0.0,>=1.6.11
  Using cached pyseto-1.7.2-py3-none-any.whl (58 kB)
Collecting protobuf<5.0.0,>=4.21.8
  Using cached protobuf-4.23.3-cp37-abi3-manylinux2014_x86_64.whl (304 kB)
Collecting Flask<3.0.0,>=2.0.0
  Using cached Flask-2.3.2-py3-none-any.whl (96 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl
Collecting charset-normalizer<4.0,>=2.0
  Using cached charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting attrs>=17.3.0
  Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (269 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.3.1-py3-none-any.whl
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting itsdangerous>=2.1.2
  Using cached itsdangerous-2.1.2-py3-none-any.whl
Collecting click>=8.1.3
  Using cached click-8.1.3-py3-none-any.whl
Collecting blinker>=1.6.2
  Using cached blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting Jinja2>=3.1.2
  Using cached Jinja2-3.1.2-py3-none-any.whl
Collecting importlib-metadata>=3.6.0
  Using cached importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Collecting iso8601<2.0.0,>=1.0.2
  Using cached iso8601-1.1.0-py3-none-any.whl
Collecting pycryptodomex<4.0.0,>=3.12.0
  Using cached pycryptodomex-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
Collecting passlib[argon2]<2.0.0,>=1.7.4
  Using cached passlib-1.7.4-py2.py3-none-any.whl
Collecting cryptography<41,>=36
  Using cached cryptography-40.0.2-cp36-abi3-manylinux_2_28_x86_64.whl (3.7 MB)
Collecting certifi>=2017.4.17
  Using cached certifi-2023.5.7-py3-none-any.whl (156 kB)
Collecting urllib3<3,>=1.21.1
  Using cached urllib3-2.0.3-py3-none-any.whl (123 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl
Collecting MarkupSafe>=2.1.1
  Using cached MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting cffi>=1.12
  Using cached cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting zipp>=0.5
  Using cached zipp-3.15.0-py3-none-any.whl
Collecting argon2-cffi>=18.2.0
  Using cached argon2_cffi-21.3.0-py3-none-any.whl
Collecting argon2-cffi-bindings
  Using cached argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl
Installing collected packages: typing_extensions, passlib, zipp, urllib3, pycryptodomex, pycparser, protobuf, multidict, MarkupSafe, itsdangerous, iso8601, idna, frozenlist, click, charset-normalizer, certifi, blinker, attrs, async-timeout, yarl, Werkzeug, requests, Jinja2, importlib-metadata, cffi, aiosignal, Flask, cryptography, argon2-cffi-bindings, aiohttp, argon2-cffi, pyseto, replit
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/site-packages/typing_extensions.py'
Consider using the `--user` option or check the permissions.

--- Logging error ---
Traceback (most recent call last):
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 177, in emit
    self.console.print(renderable, overflow="ignore", crop=False, style=style)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_vendor/rich/console.py", line 1673, in print
    extend(render(renderable, render_options))
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_vendor/rich/console.py", line 1305, in render
    for render_output in iter_render:
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 134, in __rich_console__
    for line in lines:
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_vendor/rich/segment.py", line 249, in split_lines
    for segment in segments:
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_vendor/rich/console.py", line 1283, in render
    renderable = rich_cast(renderable)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_vendor/rich/protocol.py", line 36, in rich_cast
    renderable = cast_method()
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/self_outdated_check.py", line 130, in __rich__
    pip_cmd = get_best_invocation_for_this_pip()
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/utils/entrypoints.py", line 58, in get_best_invocation_for_this_pip
    if found_executable and os.path.samefile(
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/genericpath.py", line 101, in samefile
    s2 = os.stat(f2)
FileNotFoundError: [Errno 2] No such file or directory: '/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/bin/pip'
Call stack:
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/bin/.pip-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 70, in main
    return command.main(cmd_args)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 101, in main
    return self._main(args)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    self.handle_pip_version_check(options)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 190, in handle_pip_version_check
    pip_self_version_check(session, options)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/self_outdated_check.py", line 236, in pip_self_version_check
    logger.warning("[present-rich] %s", upgrade_prompt)
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/logging/__init__.py", line 1458, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/logging/__init__.py", line 1589, in _log
    self.handle(record)
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/logging/__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/logging/__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "/nix/store/h4h5rxs0hzpzvz37yrwv1k2na1acgzww-python3-3.9.15/lib/python3.9/logging/__init__.py", line 952, in handle
    self.emit(record)
  File "/nix/store/95kl4499yaa91j0ja7vwzf5l7r3ly4b2-python3.9-pip-22.2.2/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 179, in emit
    self.handleError(record)
Message: '[present-rich] %s'
Arguments: (UpgradePrompt(old='22.2.2', new='23.1.2'),)

lol replit did so much perms denial that it accidently took the perms away from the command that installs package replit (basically, it’s trying to update typing-extension but it’s not working because of perms block)

3 Likes

What do you mean by that?