在特定的Python版本(或在特定环境下)运行的强制简化
我有一个简化的应用程序,该应用程序设置为通过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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
/path/to/your/python -m简化运行
/path/to/your/python -m streamlit run
尽管简化是一个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 executablestreamlit
. In cases where there are multiple, you can specify the exact one you want to use:/path/to/conda/env/streamlit run myApp.py
您可以从终端运行类似的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