我使用Mac,并且拥有python2.7.10,wxpython 3.0.2.0_1。坦率地说,它曾经可以工作,但是在我尝试“简单安装python3 && cp / usr / local / bin / python3 / usr / local / bin / python”之后。我无法运行ride.py并出现以下错误。
尽管我尝试回到当前的python2.7.10(而不是python3.x)
错误仍然如下。可以在这里建议我吗。
$ ride.py
Traceback (most recent call last):
File "/usr/local/bin/ride.py", line 4, in <module>
__import__('pkg_resources').run_script('robotframework-ride==2.0a1', 'ride.py')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3095, in <module>
@_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 658, in _build_master
ws.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 846, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'robotframework-ride==2.0a1' distribution was not found and is required by the application
答案 0 :(得分:0)
安装RIDE后(对于Robot Framework本身很可能是这样),这是针对python2完成的。安装python3将不复制所有已安装的软件包-就操作系统和Python安装而言,这是两个单独的程序。
这就是您在python3中看到错误的原因。
关于为什么它现在在python2中不存在-我自己不确定;当您将python3二进制文件复制到python1二进制文件时,可能会使环境有些混乱。这通常是通过符号链接完成的,而不是二进制副本。您是为python
做的,但是例如pip
最有可能仍指向python2。
我要做的是尝试在python2中卸载robotframework和RIDE,然后在python2和python3解释器中pip install
进行卸载。