Ask coding questions

← Back to all posts
Cannot perform "from replit import clear"
h
heysummerd

Hi! I'm new to coding and have been successfully using the clear() function for some projects, up until recently. Now, when I attempt either "import replit" or "from replit import clear" - I receive the following error messages. Any idea why this might be? Thanks!!

Python 3.8.2 (default, Feb 26 2020, 02:56:10)

Replit: Updating package configuration

--> python3 -m poetry add replit
Using version ^3.2.4 for replit

Updating dependencies
Resolving dependencies...

SolverProblemError

Because no versions of replit match >3.2.4,<4.0.0
and replit (3.2.4) depends on requests (>=2.25.1,<3.0.0), replit (>=3.2.4,<4.0.0) requires requests (>=2.25.1,<3.0.0).
And because clear (1.0.1) depends on requests (2.6.0)
and no versions of clear match >1.0.1,<2.0.0, replit (>=3.2.4,<4.0.0) is incompatible with clear (>=1.0.1,<2.0.0).
So, because repl-python3-blackjack-start depends on both clear (^1.0.1) and replit (^3.2.4), version solving failed.

at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
exit status 1

Replit: Package operation failed.

Voters
heysummerd
Comments
hotnewtop
SixBeeps

Looks like the Replit package needs to be fixed to support newer versions of request.

For the time being, slip this into your code:

heysummerd

@SixBeeps this worked beautifully, thank you for your help!