简体   繁体   English

在python3而非python2上安装机器人框架

[英]Install robot framework on python3 not python2

I have python3 pre-installed in fedora, somehow python2 was installed later. 我已经在fedora中预装了python3,后来又以某种方式安装了python2。 After using 使用后

pip install robotframework

robot was installed successfully, but it was installed in python 2.7/site-packages. robot已成功安装,但已安装在python 2.7 / site-packages中。

Is there any way to install and use it in python3? 有什么方法可以在python3中安装和使用它吗? Or, is it possible to uninstall python2, and re-install robot framework on python3? 或者,是否可以卸载python2,然后在python3上重新安装机器人框架?

Thanks. 谢谢。

Try this command It may help you in my case it works! 尝试使用此命令,对我来说可能会有所帮助!

pip3 install robotframework 

If you are using proxy server then use this command 如果使用代理服务器,则使用此命令

pip3 --proxy <host>:<port> install robotframework

Example

pip3 --proxy 12.3.105.200:8080 install robotframework

And you can uninstall pre-installed by using this 您可以使用此方法卸载预装的

pip uninstall robotframework

You can use below commands to install robot framework for specific python version if you had multiple python version installed, 如果您安装了多个python版本,则可以使用以下命令为特定的python版本安装机器人框架,

python -m pip install robotframework   #python 2
python3 -m pip install robotframework  #python 3 

Robotframework has versions for both python 2 and 3, so this is definitely an issue of managing your python environment. Robotframework有适用于python 2和3的版本,因此,这绝对是管理python环境的问题。

To avoid issues like this in the future, I strongly urge you to use virtual environments . 为避免将来出现此类问题,我强烈建议您使用虚拟环境

In a nutshell, you can solve this problem by doing 简而言之,您可以通过执行以下操作解决此问题

pip install virtualenv
virtualenv -p python3 venv
source venv/bin/activate
pip install robotframework

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

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