Trying to create a simple repl to demo a python package. The pyproject.toml file is updated and the Packages section lists it as installed, but when I Run I get ModuleNotFoundError for that package. I am newer to Replit but this seems like a bug.
Expected behavior:
The package is installed and usable. It is available on pypi: zillion · PyPI
I am using the “extras” format to install an extension as well in pyproject.toml:
Adding via package manager did not work, and that also wouldn’t allow installed “extras”.
I am in the process of installing from the shell now, but that does not address the bug, just works around it. That also hit a separate issue, retrying now though:
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=‘package-proxy.replit.com’, port=443): Read timed out. (read timeout=15)”)’: /pypi/simple/grpcio-tools/
Whoa, pip install from the shell installed an outdated package version! Is replit doing some weird pip setup/caching that would cause that? Latest version of zillion is 0.9.7 but it installed 0.8.2 when I did not specify a version. Retrying with a version specified in the shell…
Interesting. I can’t think of a reason for this, except that maybe the python version replit is running might be outdated, and therefore needs an older version.
Add via package manager runs into the exact same issue as initially shown on this post. Namely, it leads to ModuleNotFoundError even though it says the module is installed.
Clarification on “extras”: please see initial post again. Poetry allows installed extras with the following format: zillion = {extras = ["nlp"], version = "0.9.7"}
This bug doesn’t seem to have anything to do with guess imports.
Is “nlp” it’s own package? Otherwise I’ve never heard of “extras” before.
I was referring to the fact that all I saw from your original post was that you were importing zillon, which prompted me assuming guess imports to be at fault.
Extras are just a way of installing additional dependencies that are only relevant for certain scenarios. Many popular python packages do this as a way to not bloat the default install. For Zillion the NLP extension adds some additional packages for integrating with OpenAI to enable NLP features.
Welp, I seem to have found another bug. I deleted that repl to recreate it since I am worried the environment is become a mess now from attempted workarounds, and replit now immediately crashes and boots me from that repl page when I try to open it! I had tried to use the same name so that must be the cause of the bug on their end.
Anyhow, still not having any luck with a fresh repl.
I’ll try that, but it’s not really solving the root issue here which is replit saying something is installed when it’s not. It probably warrants raising a bug with the Replit engineering team, not sure how to do that though.
Lovely! Poetry is well-intentioned but boy does it get annoying sometimes. I wouldn’t be surprised if these versions all worked fine together but maintainers set upper bounds on versions because they couldn’t be 100% sure things would continue working with a new major version. I will have to setup an environment with pip.