Help figuring out why my python dependencies are messed up

So I have a repl that is in a weird state that I cannot dig myself out of.

if from the command line I run:

poetry run python

the app starts fine

However, if I click the run button I get:

Replit: Updating package configuration
→ python3 -m poetry lock
/home/runner/fcasanabot/venv/bin/python3: No module named poetry
exit status 1
Replit: Package operation failed.

I am sure poetry is installing dependencies to somewhere other than the venv in my local directory. But I don’t know where it is or how to tell it to use the venv.

Here is my replit.nix file:

{ pkgs }: {
deps = [
env = {
PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
# Needed for pandas / numpy
# Needed for pygame
# Needed for matplotlib
PYTHONBIN = “${pkgs.python39Full}/bin/python3.9”;
LANG = “en_US.UTF-8”;

I do have a venv directory, but this is an interesting output:

~/fcasanabot$ find . -name ‘asana’

So asana is not installed to that directory.

1 Like

well a few minutes after typing this up, i ran:

~/fcasanabot$ rm -rf .cache/pypoetry/*

and the project seems to work. Perhaps this will help someone in posterity.

Hey @nafeger welcome ot the forums.

Many people have been experiencing bugs with pakages over the past day and a bug report has been made by another community member. Here is a solution:

Needs to be changed for the package you are using

1 Like

Appreciate that quick reply @ethan, however, running pip install poetry was not successful:

~/fcasanabot$ pip install poetry
WARNING: --use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0.
WARNING: pip is using lazily downloaded wheels using HTTP range requests to obtain dependency information. This experimental feature is enabled through --use-feature=fast-deps and it is not ready for production.
Looking in indexes:
Collecting poetry
  Obtaining dependency information from poetry 1.1.14
ERROR: Exception:
Traceback (most recent call last):
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/cli/", line 180, in _main
    status =, args)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/cli/", line 205, in wrapper
    return func(self, options, args)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/commands/", line 318, in run
    requirement_set = resolver.resolve(
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 127, in resolve
    result = self._result = resolver.resolve(
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/", line 473, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/", line 341, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/", line 172, in _merge_into_criterion
    if not criterion.candidates:
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_vendor/resolvelib/", line 139, in __bool__
    return bool(self._sequence)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 143, in __bool__
    return any(self)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 129, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 33, in _iter_built
    candidate = func()
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 200, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 306, in __init__
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 151, in __init__
    self.dist = self._prepare()
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 234, in _prepare
    dist = self._prepare_distribution()
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 317, in _prepare_distribution
    return self._factory.preparer.prepare_linked_requirement(
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/operations/", line 502, in prepare_linked_requirement
    wheel_dist = self._fetch_metadata_using_lazy_wheel(link)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/operations/", line 445, in _fetch_metadata_using_lazy_wheel
    return dist_from_wheel_url(name, url, self._session)
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/network/", line 32, in dist_from_wheel_url
    with LazyZipOverHTTP(url, session) as wheel:
  File "/home/runner/fcasanabot/venv/lib/python3.9/site-packages/pip/_internal/network/", line 54, in __init__
    assert head.status_code == 200

Like Ethan mentioned, there was a bug a few days ago affecting poetry and I’m not sure if it has been fixed or not.

From your original question, if running poetry run python works fine, then you could configure the .replit file in order to make the Run button work. Just type this into the .replit file:

run="poetry run python"

Also a side note for Nix, once you make a change to the replit.nix file, you might want to type kill 1 into the Shell to update the repl.

Hope this helps!

1 Like