#๐ need some help in this code
56 messages ยท Page 1 of 1 (latest)
@modern swift
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.
one is flask the other is for the bluetooth app
so just to explain im making an app that uses ble beacon for uni when you go to class you can regiseter the class with your id and name and if you get out of range you will be signed out
Did I help you on Reddit like yesterday?
That's funny. I just helped someone who was doing basically this.
Well, their question was a lot more general, but maybe.
Yes, what's the question?
is anything wrong with the code plus what is left for me to do the app
its the first time doing this
whenever i try to run it i get the error of flask not found even though its donwloaded
i did it
redownload it
it says already satisfied
download a depracated version
how
or just import pip
how can i do it ?
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package])
# Example usage
install('requests')
it wasnt improt pip
let me try it
copy the code before the comment
gives me an error still
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package])
# Example usage
install('flask')
include in the program
it works on my system /shrug
If you have a virtual environment, you need to activate it before running pip.
thats why im a bit slow
Do you have a venv directory in your project folder?
no
What does pip list show?
How are you running the code when you get the error? And what is the exact error?
I think VSCode is just using a different version of Python than the one you have in your PATH.
I'd just set up a virtual environment. That will make it easier to control what packages you use. If you install into a global installation, that may comflict with other projects, so installing into and using the global install for projects isn't a good idea.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.