简体   繁体   English

我正在使用一个期待 Python3 的项目。 如何在不搞砸任何事情的情况下使用它?

[英]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.

相关问题 我如何删除python3中的对象* - How can i delete objects in python3.* 我正在使用python3。 我如何切换到v2.7 - I am using python3. how can i switch to v2.7 如何判断我正在使用哪个 python 实现? - How can I tell which python implementation I'm using? 我无法在python3上导入scikit -learn。 如何导入? - I can`t import scikit -learn on python3. how can i import it? 如何在另一台计算机上运行 Python 项目而不在其上安装任何东西? - How can I run a Python project on another computer without installing anything on it? 如何在 tkinter window 中创建一个循环而不弄乱 window? - How can I make a loop in a tkinter window without it messing up the window? 使用 Timegrouper '1M' 按列进行分组和求和会弄乱我的日期索引 Pandas python - Using Timegrouper '1M' to group and sum by columns is messing up my date index pandas python 如何从后台开始删除此脚本并弄乱 PowerShell? - How can I remove this script starting in the background and messing up with PowerShell? 尝试使用ftplib上传,可以很好地连接,但是在某些时候我搞砸了。 - Trying to upload with ftplib, can connect just fine, but I'm messing something up at some point. python中带有csv文件的any()函数不符合我的期望 - any() function with csv file in python not behaving how I'm expecting it to
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM