modelsim 启动时出现错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了modelsim 启动时出现错误相关的知识,希望对你有一定的参考价值。

我的modelsim在运行一个程序时出错,在任务管理器里关闭以后,在启动就会提示出现一下图片的错误。重新安装后,仍然出现同样的错误,有经验的朋友能不能帮忙解决一下

参考技术A 还用6.2 6.5都出来了

尝试启动 Firefox 时出现 Python selenium 错误

【中文标题】尝试启动 Firefox 时出现 Python selenium 错误【英文标题】:Python selenium error when trying to launch firefox 【发布时间】:2013-07-08 23:28:51 【问题描述】:

尝试在 ipython notebook 中使用 Selenium 打开 Firefox 时出现错误。我环顾四周,发现了类似的错误,但没有与我得到的错误完全匹配的错误。任何人都知道问题可能是什么以及我如何解决它?我正在使用 Firefox 22。

我输入的代码如下:

from selenium import webdriver
driver = webdriver.Firefox()

代码返回的错误如下:

    WindowsError                              Traceback (most recent call last)
<ipython-input-7-fd567e24185f> in <module>()
----> 1 driver = webdriver.Firefox()

C:\Anaconda\lib\site-packages\selenium\webdriver\firefox\webdriver.pyc in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy)
     56         RemoteWebDriver.__init__(self,
     57             command_executor=ExtensionConnection("127.0.0.1", self.profile,
---> 58             self.binary, timeout),
     59             desired_capabilities=capabilities)
     60         self._is_remote = False

C:\Anaconda\lib\site-packages\selenium\webdriver\firefox\extension_connection.pyc in __init__(self, host, firefox_profile, firefox_binary, timeout)
     45         self.profile.add_extension()
     46 
---> 47         self.binary.launch_browser(self.profile)
     48         _URL = "http://%s:%d/hub" % (HOST, PORT)
     49         RemoteConnection.__init__(

C:\Anaconda\lib\site-packages\selenium\webdriver\firefox\firefox_binary.pyc in launch_browser(self, profile)
     45         self.profile = profile
     46 
---> 47         self._start_from_profile_path(self.profile.path)
     48         self._wait_until_connectable()
     49 

C:\Anaconda\lib\site-packages\selenium\webdriver\firefox\firefox_binary.pyc in _start_from_profile_path(self, path)
     71 
     72         Popen(command, stdout=PIPE, stderr=STDOUT,
---> 73               env=self._firefox_env).communicate()
     74         command[1] = '-foreground'
     75         self.process = Popen(

C:\Anaconda\lib\subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
    677                             p2cread, p2cwrite,
    678                             c2pread, c2pwrite,
--> 679                             errread, errwrite)
    680 
    681         if mswindows:

C:\Anaconda\lib\subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
    894                                          env,
    895                                          cwd,
--> 896                                          startupinfo)
    897             except pywintypes.error, e:
    898                 # Translate pywintypes.error to WindowsError, which is

WindowsError: [Error 2] The system cannot find the file specified

【问题讨论】:

同样的代码对我有用。我正在使用 Firefox 22 和 Python 2.74。 Firefox 在您的 PATH 中吗? user1177636,这是我第一次尝试运行 selenium,所以我没有尝试使用以前版本的 Firefox 运行它。 Tobi,Firefox 的路径是 C:/Users/myname/appdata/Local/Mozilla Firefox/ - 这被认为是“在我的路径中”吗? 【参考方案1】:

在初始化Firefox()时尝试指定你的Firefox二进制文件

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('path/to/binary')
driver = webdriver.Firefox(firefox_binary=binary)

FirefoxDriver 寻找的默认路径是%PROGRAMFILES%\Mozilla Firefox\firefox.exe。见FirefoxDriver

或者将您的 Firefox 二进制路径添加到 Windows 的PATH。

【讨论】:

User1177636,感谢您的建议。我尝试了使用以下代码的建议: from selenium.webdriver.firefox.firefox_binary import FirefoxBinary binary = FirefoxBinary('Appdata/Local/Mozilla Firefox/') driver = webdriver.Firefox(firefox_binary=binary) 但我得到了同样的错误.我在 Appdata 之前尝试了带有 / 的路径,结果相同。我输入的路径是否错误? 不,先试试FirefoxBinary('C:/Users/myname/appdata/Local/Mozilla Firefox/firefox.exe')。让你的路径是正确的。打开 Windows 资源管理器,看看它是否真的存在。【参考方案2】:

出现问题是因为您没有 geckodriver

解决方案:

    转到this website 并为您的机器下载适当的版本,确保存档中有.exe 文件。 然后解压并复制.exe文件到你的目录

【讨论】:

【参考方案3】:

要求:

Ubuntu 16.04 (i386) 火狐 65.0.1. python 3.8.5 geckodriver-v0.27.0-linux32.tar.gz

这就是我的工作:

pip3 安装硒

下载geckodriver v0.27.0

提取 geckodriver

mv geckodriver /usr/local/bin/

导出 PATH=$PATH:/usr/local/bin/geckodriver

用命令检查 Xauthority --> 定位 Xauthority

cd /home/your-user/Xauthority

chown root: .Xauthority

创建python代码:

从硒导入网络驱动程序

浏览器 = webdriver.Firefox() browser.get('http://localhost')

运行 python 脚本。

【讨论】:

【参考方案4】:

当我设置环境变量 export PYTHONDONTWRITEBYTECODE=1 以在每次测试运行时删除 pyc 文件时,我遇到了同样的错误。我能够通过更新 selenium pip install --upgrade selenium 来恢复更改。 OSX (10.10)

【讨论】:

【参考方案5】:

这是有效的:

apt-get update

apt-get install -y xorg xvfb firefox dbus-x11 xfonts-100dpi xfonts-75dpi xfonts-cyrillic

【讨论】:

请说明此命令的作用。它可能会解决问题,但其他用户几乎无法从描述中获得帮助。 基本上 xvfb 由于额外的依赖关系而无法初始化。第二行包含运行 xvfb 所需的所有包。它允许 firefox 在“无头”模式下运行。【参考方案6】:

需要这两个包(ubuntu)!

apt-get update
apt-get install -y xorg xvfb firefox dbus-x11 xfonts-100dpi xfonts-75dpi xfonts-cyrillic

sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
sudo apt install linuxbrew-wrapper
brew install geckodriver

还有什么对我有用的是使用 chrome 而不是 firefox 检查本教程: https://christopher.su/2015/selenium-chromedriver-ubuntu/

【讨论】:

【参考方案7】:
    driver=webdriver.Firefox(executable_path="add geckodriver.exe",log_path=None)

【讨论】:

【参考方案8】:

你需要安装geckodriver:

https://selenium-python.readthedocs.io/installation.html

只需下载它,解压缩,然后将其复制到您的 python 目录...简单。

【讨论】:

以上是关于modelsim 启动时出现错误的主要内容,如果未能解决你的问题,请参考以下文章

1.用modelsim-altera 6.5e仿真的时候 显示 no data 2.signaltap ii 选择signal clock时出现错误

使用Modelsim的错误

2020-11-23

ise启动modelsim出现如下的错误,该怎么办

quartus2中有仿真模块modelsim时,出现Can't launch Modelsim,,怎么解决?

FPGA用,modelsim 仿真时总是出现错误,下面是错误原因,请各位大牛指教