[英]I’m using a project which is expecting Python3. How can use that without messing anything up?
I'm using a project which is calling a script where python
means python3.我正在使用一个调用脚本的项目,其中python
表示 python3。 However python -V shows version 2. I know I have both versions (python3 -V, shows expected version) installed.但是 python -V 显示版本 2。我知道我安装了两个版本(python3 -V,显示预期版本)。
How can I run a script from this project and it run the correct version of Python?如何从该项目运行脚本并运行正确版本的 Python? I suspect I shouldn't have to change anything like aliases or environment paths.我怀疑我不应该更改别名或环境路径之类的东西。 Although I haven't used them before, this sounds exactly like what a virtual env is for.虽然我以前没有使用过它们,但这听起来就像虚拟环境的用途。 Am I correct?我对么?
ETA:预计到达时间:
I'm calling a script from the command line:我正在从命令行调用脚本:
make foobar制作 foobar
Set your desired Python version on the IDE and create a virtualenv if especiall the project requires certain packages/libraries to keep it isolated and not run into certain errors down the road.在 IDE 上设置您想要的 Python 版本并创建一个 virtualenv,如果特别是该项目需要某些包/库来保持其隔离并且不会遇到某些错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.