您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python 2(而不是python 3)作为(临时)默认python?

python 2(而不是python 3)作为(临时)默认python?

您可以使用virtualenv

# Use this to create your temporary python "install"
# (Assuming that is the correct path to the python interpreter you want to use.)
virtualenv -p /usr/bin/python2.7 --distribute temp-python

# Type this command when you want to use your temporary python.
# While you are using your temporary python you will also have access to a temporary pip,
# which will keep all packages installed with it separate from your main python install.
# A shorter version of this command would be ". temp-python/bin/activate"
source temp-python/bin/activate

# When you no longer wish to use you temporary python type
deactivate

请享用!

python 2022/1/1 18:37:35 有238人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶