A possible solution is to set up a new environment for you application, that contains the Python version and the packages that are completely compatible with your application. Perhaps one of the packages is no longer compatible with the other parts of your program (due to the so-called breaking changes). But now you’ve tried to run it, and it is not working. You have an application (developed by yourself or by someone else) that once worked beautifully.In this case, you need to set up different so-called environments.Īside from this situation, there are more use cases when having additional environments might come in handy: These applications may need other versions of Python/packages than the ones you have been currently using. Then, most likely, you immerse yourself in this world, and download Python applications from GitHub, Kaggle or other sources. When you start learning Python, it is a good starting point to install the newest Python version with the latest versions of the packages you need or want to play around with. So why exactly do you need Python environments? You might ask: shouldn’t I just install the latest Python version? Why you need multiple Python environments If you’ve opened this article, chances are that you already know what Python is, why it is a great tool, and you even have a Python installed on your computer. ![]() Thus, my main motivation for writing this article was to help current and potential Python users to have a better understanding of how to manage such environments. I’ve been teaching it for quite some time now, and according to my experience, establishing Python environments is a challenging topic. Then streamlit run app.py should run correctly too.I have over two decades of professional experience as a developer, I know a wide variety of frameworks and programming languages, and one of my favorites is Python. Your prompt should then have the name of the environment preprended like (streamlit_environment) >, which means python and streamlit will be run from the conda folder. in any Anaconda prompt (you can open one from the Start menu), activate your conda environment with conda activate.In this new terminal, streamlit should be accessible, then you can browse to the folder with your script through a cd command and run streamlit run app.py follow the procedure in the Wiki to open a terminal from the Anaconda navigator, with the Conda environment where Streamlit is installed.If you want to run Streamlit on a file anyway on your computer, you can activate the conda environment in your terminal so that it will use streamlit and python in this folder : Which means Streamlit is installed inside a conda environment with numpy, pandas etc…and when you put a script inside the conda folder, it’s true it will use the Python executable and streamlit installed in this folder. Since you’re running Anaconda on Windows, I assume you followed the same steps as Streamlit’s Installing in a conda environment guide (don’t hesitate to drop and recreate an environment from scratch, Conda is good for this). ![]() ![]() I’m not sure I understood your issue, so I’m answering to what I understood of your issue and then will let you correct me ! You want streamlit to be available to run a script from anywhere on your computer. ![]() Question: is there a way to seth the path in streamlit (from conda) so that running a file, for example, can be done with: streamlit run streamtest3.py
0 Comments
Leave a Reply. |