Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
The environment variables are cleared when you exit the terminal and it is required that we need to set them again when we launch the terminal.
In vs code using bash in Ubuntu, if that is the case, look for setting the env variables in the .bash_profile so that it remembers the variables even after the terminal program is closed.
I suggest you use .env file in order to handle environment configuration in Flask.
It's a file that stores all the necessary environment data and should be changed between development, production, etc.
There is an excellent tutorial about flask by Miguel Grinberg, the part about the environment is
here.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have an external drive from my old PC and I would like to continue working on some projects there, I have set up python but on my VSCode I keep getting "workspace contains pipfile but pipenv was not found". What's the solution to this?
You should first install pipenv to your machine eg:
pip install pipenv
Create a virtual env in the folder you'll be working in. Install Django together with other dependencies you'll be using. Wallah you're ready to start working.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I just made a virtual environment but trying to open it with
mypython\Scripts\activate
Can anybody tell me why this is not working?
In the picture you are actually trying with 'mypthon' and not 'mypython'. But as i understand it, the virtual environment you're trying to activate in your picture is actually in a folder called 'venv' and not 'mypython'. Therefore i think it could be that you instead should write
venv\Scripts\activate
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have installed Python package 'forcast' using root and it runs fine but all other Linux users wont be able to see this package or import it in code .
Please help me, i have checked /usr/lib/ all package are present.
Is it possible that users do not have permission to access the files? check the access modes to the files in the package - you need +rx for directories and +r for files.
Another option is that this path is not searched by default, and you need to add it to PYTHONPATH for the users.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Before you get confused, I am going to compile it with the auto-py-to-exe module after, its just the source code is in python. How do I do this?
If Python is not installed you wouldn't even be able to run a script to check if it's installed.
I'm pretty sure there isn't from inside the Python script. Because the interpreter isn't installed, so it'll never be able to understand HOW to execute the script at all.
You'll have to check outside in whatever is initiating the Python script and the compilation (bash script?) and do it there.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I've just started learning Python, and I'm pretty lost right now. I want to run my script on my server that is hosted through hosting24.com. Their FAQ says they support Python, but I have no clue where to put my script for it to run.
There is a folder called cgi-bin in my root, I'm guessing that is where I put my script? Can someone explain to me how this works?
Very simply, you can rename your Python script to "pythonscript.cgi".
Post that in your cgi-bin directory, add the appropriate permissions and browse to it.
This is a great link you can start with.
Here's another good one.
Hope that helps.
EDIT (09/12/2015): The second link has long been removed. Replaced it with one that provides information referenced from the original.