mrakgr
September 23, 2023, 10:34am
1
Bug description:
We were running into issues installing mdtex2html
last week, see here , and now we are trying to work around that by starting a fresh Replit and importing our existing code from Github.
What is happening is that in our new Flask replit, we donβt have access to Flask even after all the packages have been installed.
Expected vs Current Behavior:
Traceback (most recent call last):
File "main.py", line 2, in <module>
from app import flaskapp, db
File "/home/runner/DLResurrect-1/app/__init__.py", line 2, in <module>
from flask import Flask
ModuleNotFoundError: No module named 'flask'
This is what happens when we press the Run button or try running main.py
ourselves. It also doesnβt work when we try importing it the console directly. Also, none of the other installed modules can be imported either.
Steps to reproduce:
Try installing the packages using poetry install
and running the Repl.
Bug appears at this link: https://replit.com/@mngrwl/DLNotWorking
Screenshot(s)/Screen Recording:
Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.36
Replit Profile: https://replit.com/@mrakgr
mrakgr
September 23, 2023, 10:35am
2
It bears mentioning that all the packages are getting installed from the shell, but it doesnβt seem like the Repl is reading them from the right place.
Hi @mrakgr , welcome to the forums!
Can you try entering pip install flask
into the Shell?
Thanks!
mrakgr
September 23, 2023, 10:38am
4
~/DLNotWorking$ pip install flask
Looking in indexes: https://package-proxy.replit.com/pypi/simple/
Collecting flask
Downloading https://package-proxy.replit.com/pypi/packages/fa/1a/f191d32818e5cd985bdd3f47a6e4f525e2db1ce5e8150045ca0c31813686/Flask-2.3.2-py3-none-any.whl (96 kB)
|ββββ | 10 kB 12.6 MB/s eta 0:00
|βββββββ | 20 kB 3.8 MB/s eta 0:00:
|βββββββββββ | 30 kB 5.2 MB/s eta 0:00:
|ββββββββββββββ | 40 kB 1.8 MB/s eta 0:00:
|βββββββββββββββββ | 51 kB 2.0 MB/s eta 0:00:
|βββββββββββββββββββββ | 61 kB 2.4 MB/s eta 0:00:
|ββββββββββββββββββββββββ | 71 kB 2.6 MB/s eta 0:00:
|βββββββββββββββββββββββββββ | 81 kB 2.9 MB/s eta 0:00:
|βββββββββββββββββββββββββββββββ | 92 kB 3.0 MB/s eta 0:00:
|ββββββββββββββββββββββββββββββββ| 96 kB 3.3 MB/s
Collecting Jinja2>=3.1.2
Using cached Jinja2-3.1.2-py3-none-any.whl
Collecting Werkzeug>=2.3.3
Downloading https://package-proxy.replit.com/pypi/packages/9b/59/a7c32e3d8d0e546a206e0552a2c04444544f15c1da4a01df8938d20c6ffc/werkzeug-2.3.7-py3-none-any.whl (242 kB)
|ββ | 10 kB 20.9 MB/s eta 0:00
|βββ | 20 kB 26.3 MB/s eta 0:00
|ββββ | 30 kB 31.3 MB/s eta 0:00
|ββββββ | 40 kB 15.3 MB/s eta 0:00
|βββββββ | 51 kB 12.1 MB/s eta 0:00
|βββββββββ | 61 kB 12.8 MB/s eta 0:00
|ββββββββββ | 71 kB 12.0 MB/s eta 0:00
|βββββββββββ | 81 kB 10.8 MB/s eta 0:00
|βββββββββββββ | 92 kB 11.7 MB/s eta 0:00
|ββββββββββββββ | 102 kB 11.2 MB/s eta 0:0
|βββββββββββββββ | 112 kB 11.2 MB/s eta 0:0
|βββββββββββββββββ | 122 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββ | 133 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββ | 143 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββββ | 153 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββββββ | 163 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββββββ | 174 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββββββββ | 184 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββββββββββ | 194 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββββββββββ | 204 kB 11.2 MB/s eta 0:0
|βββββββββββββββββββββββββββββ | 215 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββββββββββββββ | 225 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββββββββββββββββ| 235 kB 11.2 MB/s eta 0:0
|ββββββββββββββββββββββββββββββββ| 242 kB 11.2 MB/s
Collecting blinker>=1.6.2
Downloading https://package-proxy.replit.com/pypi/packages/0d/f1/5f39e771cd730d347539bb74c6d496737b9d5f0a53bc9fdbf3e170f1ee48/blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting itsdangerous>=2.1.2
Using cached itsdangerous-2.1.2-py3-none-any.whl
Collecting click>=8.1.3
Downloading https://package-proxy.replit.com/pypi/packages/1a/70/e63223f8116931d365993d4a6b7ef653a4d920b41d03de7c59499962821f/click-8.1.6-py3-none-any.whl (97 kB)
|ββββ | 10 kB 14.2 MB/s eta 0:00
|βββββββ | 20 kB 16.6 MB/s eta 0:00
|ββββββββββ | 30 kB 18.5 MB/s eta 0:00
|ββββββββββββββ | 40 kB 19.4 MB/s eta 0:00
|βββββββββββββββββ | 51 kB 20.3 MB/s eta 0:00
|ββββββββββββββββββββ | 61 kB 20.8 MB/s eta 0:00
|ββββββββββββββββββββββββ | 71 kB 21.1 MB/s eta 0:00
|βββββββββββββββββββββββββββ | 81 kB 21.3 MB/s eta 0:00
|βββββββββββββββββββββββββββββββ | 92 kB 21.5 MB/s eta 0:00
|ββββββββββββββββββββββββββββββββ| 97 kB 19.8 MB/s
Collecting MarkupSafe>=2.0
Downloading https://package-proxy.replit.com/pypi/packages/12/b3/d9ed2c0971e1435b8a62354b18d3060b66c8cb1d368399ec0b9baa7c0ee5/MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
WARNING: pip is using a content-addressable pool to install files from. This experimental feature is enabled through --use-feature=content-addressable-pool and it is not ready for production.
Installing collected packages: MarkupSafe, Werkzeug, Jinja2, itsdangerous, click, blinker, flask
Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.3 Werkzeug-2.3.7 blinker-1.6.2 click-8.1.6 flask-2.3.3 itsdangerous-2.1.2
After this, I still get the same flask not found error when I try to run it.
@mrakgr Can you try entering poetry add flask
into the Shell?
mrakgr
September 23, 2023, 10:39am
6
~/DLNotWorking$ poetry add flask
The following packages are already present in the pyproject.toml and will be skipped:
β’ flask
If you want to update it to the latest compatible version, you can use `poetry update package`.
If you prefer to upgrade it to the latest available version, you can use `poetry add package@latest`.
Nothing to add.
I am getting the same module not found error when I try to run it.
KAlexK
September 23, 2023, 10:41am
7
Try to transfer your repl to the Flask template and reinstall it in the new library repl.
1 Like
@mrakgr Try what @KAlexK suggested, or do poetry update flask
.
1 Like
mrakgr
September 23, 2023, 10:43am
9
Iβll try doing what he suggested, I am just wondering how to import an existing repo on top of itβ¦
@mrakgr In the repo import page, select the Flask template in the languages list.
Or you can try this:
youβre using the Beta template. I donβt know what got you to having poetry and pip installed in replspace, but try after you run in Shell:
rm .pythonlibs -r
poetry remove poetry
poetry add mpmath
mrakgr
September 23, 2023, 10:50am
11
No, I donβt have the same error as in that post. It is just that it is not importing right. Let me try again from the top.
@mrakgr Could you try this:
Try to transfer your repl to the Flask template and reinstall it in the new library repl.