从版本2.7.0开始,Jython包含了捆绑的pip。只需要在使用它之前运行以下命令来激活它:
jython -m ensurepip
实际上,之后应该可以使用
安装Selenium2Library for Robot Frameworkjython -m pip install robotframework-selenium2library
正确?
但是当我这样做时,我收到以下错误:
AttributeError: 'module' object has no attribute 'geteuid'
这是完整的cmd / shell输出:
C:\foldername>jython -m pip install selenium2library
Traceback (most recent call last):
File "C:\Jython27\Lib\runpy.py", line 151, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "C:\Jython27\Lib\runpy.py", line 151, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "C:\Jython27\Lib\runpy.py", line 109, in _get_module_details
return _get_module_details(pkg_main_name)
File "C:\Jython27\Lib\runpy.py", line 109, in _get_module_details
return _get_module_details(pkg_main_name)
File "C:\Jython27\Lib\runpy.py", line 101, in _get_module_details
loader = get_loader(mod_name)
File "C:\Jython27\Lib\pkgutil.py", line 478, in get_loader
return find_loader(fullname)
File "C:\Jython27\Lib\pkgutil.py", line 488, in find_loader
for importer in iter_importers(fullname):
File "C:\Jython27\Lib\pkgutil.py", line 439, in iter_importers
__import__(pkg)
File "C:\Jython27\Lib\site-packages\pip\__init__.py", line 10, in <module>
from pip.util import get_installed_distributions, get_prog
File "C:\Jython27\Lib\site-packages\pip\util.py", line 17, in <module>
from pip.locations import (
File "C:\Jython27\Lib\site-packages\pip\locations.py", line 109, in <module>
build_prefix = _get_build_prefix()
File "C:\Jython27\Lib\site-packages\pip\locations.py", line 90, in _get_build_
prefix
if file_uid != os.geteuid():
AttributeError: 'module' object has no attribute 'geteuid'
为什么我收到此错误?
BTW:从源代码安装很好用
jython setup.py install
添加信息:我在Windows 8.1 64位上使用Java 1.8,Jython 2.7.0,Robot Framework 2.8.7
答案 0 :(得分:3)
我在安装Jython 2.7.0后也遇到了这个问题。似乎由于某种原因PIP 1.6(真的很旧)被使用(导致该错误),这个步骤应该解决它:
jython -m pip install -U pip to upgrade pip
以卸载PIP并将其升级到7.x 希望这有帮助!