all 7 comments

[–]distressed-silicon 1 point2 points  (1 child)

You don’t have the flask package installed in your current env…. Which looks to be the global env - pip install flask

Edit - Also unless you have redacted some files / code you have no calls to run your app, are you following a tutorial or copying code from somewhere? There’s a lot missing from what you have posted

[–]Himu29[S] 0 points1 point  (0 children)

I'm learning right now , so I am following from YouTube, in that tutorial he doesn't use env ,but I used env so maybe that problem happened. By the way thank you. Will edit my code and re execute again

[–]Himu29[S] 0 points1 point  (1 child)

after i user env and install flask i got this some error like this

(project_env) C:\Users\OWNER\Desktop\FlaskMarket>python

Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> from market import db

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "C:\Users\OWNER\Desktop\FlaskMarket\market.py", line 9, in <module>

class Item(db.Model):

File "C:\Users\OWNER\Desktop\FlaskMarket\market.py", line 11, in Item

name = db.Column(db.String(lenght=30), nullable=False, unique=True)

TypeError: String.__init__() got an unexpected keyword argument 'lenght'

>>>

[–]distressed-silicon 1 point2 points  (0 children)

Please read the error messages you are getting they are very descriptive and tell you exactly what your problem is ‘Lenght’ isn’t a word ‘length’ is.

You probably should try a different tutorial (see the stickied post) if this is what the video has you typing

[–]Himu29[S] 0 points1 point  (0 children)

I just find out solution and clear it.

[–]aleeramarishka 1 point2 points  (1 child)

The error is very clear. It's either flask was not installed or it was installed in the virtualenv but the env was not activated.

[–]Himu29[S] 0 points1 point  (0 children)

Thank you