在特定的Python版本(或在特定环境下)运行的强制简化

发布于 2025-02-09 07:56:07 字数 309 浏览 3 评论 0原文

我有一个简化的应用程序,该应用程序设置为通过DoubleClick a *.bat文件运行,该文件包含命令启动应用程序的命令:spactlit run myapp.py。有人知道如何强制该应用程序以特定的Python版本运行吗?我的基本python是3.9,我基于Python 3.6创建了一个环境(Conda Env Create ...),在该环境中我安装了简化并创建了该应用程序,我希望它运行在那里。我使用该环境打开SYPDER,仔细检查了Env处于活动状态(!python-在Spyder控制台中进行),但是当我使用 *BAT文件运行该应用程序时,它表明该应用程序正在Python 3.8中运行!

I have a streamlit app that is set to run by doubleclicking a *.bat file that contains the command to start the app: streamlit run myApp.py. Does anyone know how to force that app to run in specific python version? My base python is 3.9, I created an environment (conda env create ...) based on python 3.6 where I installed streamlit and created the app and I want it to run there. I open sypder using that environment, double-checked that the env is active (!python --version in the spyder console) but when I run the app using the *bat file, it shows that is running in python 3.8!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深陷 2025-02-16 07:56:07

/path/to/your/python -m简化运行

/path/to/your/python -m streamlit run

紫﹏色ふ单纯 2025-02-16 07:56:07

尽管简化是一个Python库(并且曾经是独立公司),但在此上下文中,简化运行myApp.py是对可执行文件shatlit的引用。如果有倍数,则可以指定要使用的确切一个:

/path/to/conda/conda/env/shartlit运行myapp.py

Although Streamlit is a Python library (and used to be a stand-alone company), streamlit run myApp.py in that context is a reference to an executable streamlit. In cases where there are multiple, you can specify the exact one you want to use:

/path/to/conda/env/streamlit run myApp.py

爱冒险 2025-02-16 07:56:07

您可以从终端运行类似的python的特定版本:
$ python3.10 -m简化run app.py

在Windows上,例如:
$ py -3.10 -m简化运行app.py

You can run specific version of python like this from terminal:
$ python3.10 -m streamlit run app.py

On Windows like:
$ py -3.10 -m streamlit run app.py

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文