[英]Permission error [Errno13]Permission denied while installing robotframework-SikuliLibrary
I have a Linux machine with Ubuntu rel 20.10, I'm using the robot framework with Eclipse.我有一台 Linux 机器和 Ubuntu rel 20.10,我正在使用带有 Eclipse 的机器人框架。 I have a problem with a Sikulilibrary doesnt'work.
我有一个 Sikulilibrary 不起作用的问题。 I tried to
pip install robotframework-SikuliLibrary
,我试图
pip install robotframework-SikuliLibrary
,
But i have this error但我有这个错误
> Exception : Initializing test library Sikulilibrary with no arguments
> failed:Permission error[Errno13]Permission denied
I tried to install Selenium library all is ok,do you have any questions about this issue?我尝试安装 Selenium 库一切正常,您对此问题有任何疑问吗?
Robotframework 3.2机器人框架 3.2
Python 3.8.6 Python 3.8.6
Thanks a lot非常感谢
Make sure that you are adding the module in the correct Python installation (your Python 3.8 and not the system Python) and that you are installing in your home directory.确保您在正确的 Python 安装(您的 Python 3.8 而不是系统 Python)中添加模块,并且您正在安装在您的主目录中。 This way no special permission will be needed.
这样就不需要特别许可了。
pip3 install --user robotframework-SikuliLibrary
The above will install the package in the user site-packages directory of the current (running) Python.以上将package安装在当前(运行)Python的用户站点包目录中。 In my case it is
~/.local/lib/Python3.9/site-packages
, which is already in my PATH
.就我而言,它是
~/.local/lib/Python3.9/site-packages
,它已经在我的PATH
中。 It should be the case for you too, so you should be good to go.你也应该是这样,所以你应该对 go 好。
Otherwise, if you have problems like ModuleNotFoundError
just find your site-packages
directory with:否则,如果您遇到像
ModuleNotFoundError
这样的问题,只需找到您的site-packages
目录:
python3 -m site
You will have it under USER_SITE
.您将在
USER_SITE
下拥有它。 Take note of it and add it to PATH
following help from this question.记下它并在此问题的帮助下将其添加到
PATH
中。
Otherwise, like @Metal3D said, you could use a virtual environment否则,就像@Metal3D 所说,您可以使用虚拟环境
pip
wants to install the package in your system, and you don't have the right to write here. pip
想在你的系统中安装package,这里你无权写。 But... Do NOT use sudo
with pip
.但是...不要将
sudo
与pip
一起使用。 This will install system-wide and can break your installation or a package can overwrite this one.这将在系统范围内安装,并且可能会破坏您的安装,或者 package 可以覆盖这个。
Use virtualenv, or pipenv.使用 virtualenv 或 pipenv。
Eg To use virtualenv:例如要使用 virtualenv:
cd your-project
python -mvenv .venv
source .venv/bin/activate
# and then
pip install XXX
You will need to call source.venv/bin/activate
anytime you want to work and launch your project.您需要随时调用
source.venv/bin/activate
并启动您的项目。 The behavior is to change the installation path to a local path (and not your system).行为是将安装路径更改为本地路径(而不是您的系统)。
Or, like said @BIOS in https://stackoverflow.com/a/66785567/1472048 comment, use your "home" installation with "--user" option to install in ~/.local/lib
.或者,就像在https://stackoverflow.com/a/66785567/1472048评论中所说的@BIOS 一样,使用带有“--user”选项的“家庭”安装来安装在
~/.local/lib
中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.