#๐ python for pip pip for flask
66 messages ยท Page 1 of 1 (latest)
@midnight marsh
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
What does py tell you?
Okay, so you have Python.
If you want to use pip with it, you'd do py -m pip.
(you could also go into the installer and add Python to PATH but py -m pip is a good habit to get into)
U know it worked if u dont see the >>> anymore
That worked. Congrats
Dewayne
Now you can install what you want with pip
Try the py -m pip again
do you guys know the code for flask?
You want to install flask?
!pypi flask
yeah
pip install flask
py -m pip install
py -m pip install flask since we have to be absolutely explicit here
Not any of those alone but the whole orchestra is needed
the !pypi flask was invoking the bot to give a link to Flask. See this message:
#1337162853144334450 message
At the very end of it write the modules name
Like this
What happened after running this command?
Now run the code
It most probably is what u want to see
Is the whole code at the moment just that import?
Bc in that case ur good to continue
Get what
this part
If ur program would be
print("hello world")
U would expect hello world in terminal instead of nothing
Thats true but the code yet is just the import
i tried this nothing changed when i ran
No they had an app defined with a route
you can probably do py -m flask --app app run --debug
Oh ye the hello world works u need to start the app still
in terminal or vs code
U need an app.run with some args which i dont remember at the end of the code to run it
We usually add it in a
if __name__=="__main__"
So it only starts when its ran and not when its imported
!d flask.Flask.run
run(host=None, port=None, debug=None, load_dotenv=True, **options)```
Runs the application on a local development server.
Do not use `run()` in a production setting. It is not intended to meet security and performance requirements for a production server. Instead, see [Deploying to Production](https://flask.palletsprojects.com/en/latest/deploying/) for WSGI server recommendations.
If the [`debug`](https://flask.palletsprojects.com/en/latest/api/#flask.Flask.debug) flag is set the server will automatically reload for code changes and show a debugger in case an exception happened...
I reccomended debug mode for u and if it has a problem with not getting a host than localhost should fit that arg
If you read the tutorial on the official documentation, you should be able to get there
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.