简体   繁体   English

如何在命令行中指定pip安装的python版本

[英]how to specify the version of python in command line for pip install

While installing OpenBayes module (from .exe file) for py2 i got error: "could not set a key value" (not a python error, but in dialog window) 为py2安装OpenBayes模块(从.exe文件)时,出现错误:“无法设置键值”(不是python错误,但在对话框窗口中)

I tried using pip install from a command line, but still get errors there. 我尝试从命令行使用pip install,但在那里仍然出现错误。

Command "python setup.py egg_info" failed with error code 1 in C:\Users\CD3B~1\AppData\Local\Temp\pip-build-m4nnwa4o\OpenBayes\

Also not sure which python (2 or 3) is used when i type a command from console(I have both, but it seems that the OpenBayes module doesn't work with py3. 当我从控制台键入命令时,我也不确定使用哪个python(2或3)(我有两个,但似乎OpenBayes模块不适用于py3。

How should I specify the version while running pip install from command line? 从命令行运行pip install时应如何指定版本?

你可以做

python2.7 /usr/bin/pip install package

我曾经遇到此错误,对我来说,我在python 2.x担任过pip ,在python3.x使用pip3 python3.x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM