- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
关于标题问题的文章很多,但没有一篇对我有用。详细错误如下:
Traceback (most recent call last):
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in <module>
from . import _mysql
ImportError: dlopen(/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/hiteshagarwal/Documents/venv/bin/airflow", line 25, in <module>
from airflow.configuration import conf
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/airflow/__init__.py", line 47, in <module>
settings.initialize()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/airflow/settings.py", line 403, in initialize
configure_adapters()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/airflow/settings.py", line 326, in configure_adapters
import MySQLdb.converters
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/MySQLdb/__init__.py", line 24, in <module>
version_info, _mysql.version_info, _mysql.__file__
NameError: name '_mysql' is not defined
如果我使用 pip 从 python 环境中卸载 mysqlclient 然后我得到这样的错误然后我的 airflow 网络服务器和调度程序运行但不是 airflow worker 而在上述情况下任何 airflow 命令都不起作用。
-------------- celery@Hiteshs-MBP v4.4.7 (cliffs)
--- ***** -----
-- ******* ---- Darwin-20.3.0-x86_64-i386-64bit 2021-05-09 16:11:23
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: airflow.executors.celery_executor:0x7fe6603a9668
- ** ---------- .> transport: sqla+mysql://airflow:**@localhost:3306/airflow
- ** ---------- .> results: mysql://airflow:**@localhost:3306/airflow
- *** --- * --- .> concurrency: 16 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> default exchange=default(direct) key=default
[tasks]
. airflow.executors.celery_executor.execute_command
[2021-05-09 16:11:23,308: INFO/MainProcess] Connected to sqla+mysql://airflow:**@localhost:3306/airflow
[2021-05-09 16:11:23,318: CRITICAL/MainProcess] Unrecoverable error: ModuleNotFoundError("No module named 'MySQLdb'")
Traceback (most recent call last):
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/worker/worker.py", line 208, in start
self.blueprint.start(self)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/bootsteps.py", line 369, in start
return self.obj.start()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/worker/consumer/tasks.py", line 41, in start
c.connection, on_decode_error=c.on_decode_error,
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/celery/app/amqp.py", line 304, in TaskConsumer
**kw
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/messaging.py", line 386, in __init__
self.revive(self.channel)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/messaging.py", line 408, in revive
self.declare()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/messaging.py", line 421, in declare
queue.declare()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/entity.py", line 611, in declare
self._create_queue(nowait=nowait, channel=channel)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/entity.py", line 620, in _create_queue
self.queue_declare(nowait=nowait, passive=False, channel=channel)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/entity.py", line 655, in queue_declare
nowait=nowait,
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/virtual/base.py", line 531, in queue_declare
self._new_queue(queue, **kwargs)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 101, in _new_queue
self._get_or_create(queue)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 80, in _get_or_create
obj = self.session.query(self.queue_cls) \
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 75, in session
_, Session = self._open()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 65, in _open
engine = self._engine_from_config()
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 54, in _engine_from_config
return create_engine(conninfo.hostname, **transport_options)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 520, in create_engine
return strategy.create(*args, **kwargs)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/Users/hiteshagarwal/Documents/venv/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi
return __import__("MySQLdb")
ModuleNotFoundError: No module named 'MySQLdb'
Starting flask
* Serving Flask app "airflow.bin.cli" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
[2021-05-09 16:11:23,815] {_internal.py:122} INFO - * Running on http://0.0.0.0:8793/ (Press CTRL+C to quit)
(venv) hiteshagarwal@Hiteshs-MBP Documents %
我在 airflow.cfg 中使用的数据库配置 --
executor = CeleryExecutor
sql_alchemy_conn = postgresql+psycopg2://hiteshagarwal:<password>@127.0.0.1:5432/airflow --postgres
broker_url = sqla+mysql+pymysql://airflow:<password>@localhost:3306/airflow --mysql
celery_result_backend = db+mysql+pymysql://hiteshagarwal:<password>@localhost/airflow --mysql
安装pip install apache-airflow-backport-providers-mysql后,出现以下错误:
(airflow-env) hiteshagarwal@Hiteshs-MBP Documents % airflow worker
-------------- celery@Hiteshs-MBP v4.4.7 (cliffs)
--- ***** -----
-- ******* ---- Darwin-20.3.0-x86_64-i386-64bit 2021-05-09 17:02:30
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: airflow.executors.celery_executor:0x7fd1fafa79b0
- ** ---------- .> transport: sqla+mysql://airflow:**@localhost:3306/airflow
- ** ---------- .> results: mysql://airflow:**@localhost:3306/airflow
- *** --- * --- .> concurrency: 16 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> default exchange=default(direct) key=default
[tasks]
. airflow.executors.celery_executor.execute_command
[2021-05-09 17:02:31,159: INFO/MainProcess] Connected to sqla+mysql://airflow:**@localhost:3306/airflow
[2021-05-09 17:02:31,178: CRITICAL/MainProcess] Unrecoverable error: ImportError('dlopen(/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so, 2): Symbol not found: _mysql_affected_rows\n Referenced from: /Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so\n Expected in: flat namespace\n in /Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so')
Traceback (most recent call last):
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/worker/worker.py", line 208, in start
self.blueprint.start(self)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/bootsteps.py", line 369, in start
return self.obj.start()
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/worker/consumer/tasks.py", line 41, in start
c.connection, on_decode_error=c.on_decode_error,
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/celery/app/amqp.py", line 304, in TaskConsumer
**kw
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/messaging.py", line 386, in __init__
self.revive(self.channel)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/messaging.py", line 408, in revive
self.declare()
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/messaging.py", line 421, in declare
queue.declare()
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/entity.py", line 611, in declare
self._create_queue(nowait=nowait, channel=channel)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/entity.py", line 620, in _create_queue
self.queue_declare(nowait=nowait, passive=False, channel=channel)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/entity.py", line 655, in queue_declare
nowait=nowait,
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/virtual/base.py", line 531, in queue_declare
self._new_queue(queue, **kwargs)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 101, in _new_queue
self._get_or_create(queue)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 80, in _get_or_create
obj = self.session.query(self.queue_cls) \
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 75, in session
_, Session = self._open()
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 65, in _open
engine = self._engine_from_config()
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 54, in _engine_from_config
return create_engine(conninfo.hostname, **transport_options)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 500, in create_engine
return strategy.create(*args, **kwargs)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 118, in dbapi
return __import__("MySQLdb")
File "/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in <module>
import _mysql
ImportError: dlopen(/Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/hiteshagarwal/Documents/WMall/airflow-env/lib/python3.7/site-packages/_mysql.cpython-37m-darwin.so
Starting flask
* Serving Flask app "airflow.bin.cli" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
[2021-05-09 17:02:32,079] {_internal.py:122} INFO - * Running on http://0.0.0.0:8793/ (Press CTRL+C to quit)
(airflow-env) hiteshagarwal@Hiteshs-MBP Documents %
我尝试了网上提供的许多解决方案,但没有一个有效。下面是我在我的 venv 中安装的库列表:
alabaster==0.7.12
alembic==1.6.2
amqp==2.6.1
apache-airflow==1.10.12
apispec==1.3.3
appdirs==1.4.4
argcomplete==1.12.3
astor==0.8.1
attrs==19.3.0
autoflake==1.4
Babel==2.9.1
bandit==1.7.0
billiard==3.6.4.0
black==20.8b1
cached-property==1.5.2
cattrs==1.0.0
celery==4.4.7
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
colorama==0.4.4
colorlog==4.0.2
configparser==3.5.3
coverage==5.5
croniter==0.3.37
darglint==1.8.0
defusedxml==0.7.1
dill==0.3.3
distlib==0.3.1
dnspython==2.1.0
doc8==0.8.1
docutils==0.17.1
email-validator==1.1.2
eradicate==1.0
filelock==3.0.12
flake8==3.9.2
flake8-2020==1.6.0
flake8-bandit==2.1.2
flake8-broken-line==0.2.1
flake8-bugbear==19.8.0
flake8-builtins==1.5.3
flake8-commas==2.0.0
flake8-comprehensions==3.4.0
flake8-debugger==3.2.1
flake8-docstrings==1.6.0
flake8-eradicate==0.4.0
flake8-fixme==1.1.1
flake8-isort==3.0.1
flake8-logging-format==0.6.0
flake8-mutable==1.2.0
flake8-polyfill==1.0.2
flake8-quotes==2.1.2
flake8-rst-docstrings==0.0.12
flake8-string-format==0.2.3
flake8-variables-names==0.0.3
Flask==1.1.2
Flask-Admin==1.5.4
Flask-AppBuilder==2.3.4
Flask-Babel==1.0.0
Flask-Caching==1.3.3
Flask-JWT-Extended==3.25.1
Flask-Login==0.4.1
Flask-OpenID==1.2.5
Flask-SQLAlchemy==2.4.4
flask-swagger==0.2.14
Flask-WTF==0.14.3
funcsigs==1.0.2
future==0.18.2
gitdb==4.0.7
GitPython==3.1.15
graphviz==0.16
greenlet==1.1.0
gunicorn==20.1.0
idna==2.10
imagesize==1.2.0
importlib-metadata==4.0.1
iniconfig==1.1.1
iso8601==0.1.14
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.11.3
json-merge-patch==0.2
jsonschema==3.2.0
kombu==4.6.11
lazy-object-proxy==1.6.0
lockfile==0.12.2
Mako==1.1.4
Markdown==2.6.11
MarkupSafe==1.1.1
marshmallow==2.21.0
marshmallow-enum==1.5.1
marshmallow-sqlalchemy==0.25.0
mccabe==0.6.1
mypy-extensions==0.4.3
natsort==7.1.1
numpy==1.20.2
packaging==20.9
pandas==1.1.5
pathspec==0.8.1
pbr==5.6.0
pendulum==1.4.4
pep8-naming==0.9.1
pluggy==0.13.1
prison==0.1.3
psutil==5.8.0
psycopg2-binary==2.8.6
py==1.10.0
pycodestyle==2.7.0
pydocstyle==5.1.1
pyflakes==2.3.1
Pygments==2.9.0
PyJWT==2.1.0
PyMySQL==1.0.2
pyparsing==2.4.7
pyrsistent==0.17.3
pytest==6.2.4
pytest-cov==2.11.1
python-daemon==2.3.0
python-dateutil==2.8.1
python-editor==1.0.4
python-nvd3==0.15.0
python-slugify==4.0.1
python3-openid==3.2.0
pytz==2021.1
pytzdata==2020.1
pyupgrade==2.15.0
PyYAML==5.4.1
regex==2021.4.4
requests==2.25.1
restructuredtext-lint==1.3.2
setproctitle==1.2.2
six==1.16.0
smmap==4.0.0
snowballstemmer==2.1.0
Sphinx==2.4.4
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
SQLAlchemy==1.3.23
SQLAlchemy-JSONField==0.9.0
SQLAlchemy-Utils==0.37.2
stevedore==3.3.0
tabulate==0.8.9
tenacity==4.12.0
testfixtures==6.17.1
text-unidecode==1.3
thrift==0.13.0
tokenize-rt==4.1.0
toml==0.10.2
tox==3.23.1
tox-travis==0.12
typed-ast==1.4.3
typing-extensions==3.10.0.0
tzlocal==1.5.1
unicodecsv==0.14.1
urllib3==1.26.4
vine==1.3.0
virtualenv==20.4.6
wemake-python-styleguide==0.14.1
Werkzeug==0.16.1
WTForms==2.3.3
zipp==3.4.1
zope.deprecation==4.4.0
最佳答案
https://newbedev.com/nameerror-name-mysql-is-not-defined-after-setting-change-to-mysql
上面的链接对我有帮助
pip install mysql-client
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$PATH"
关于mysql - 名称错误 : name '_mysql' is not defined -- On airflow start in MacOSX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67456855/
我正在使用 C++11 线程构建一个应用程序,但我似乎无法让它在 MacOSX 10.9 上与 clang++ 一起工作。这是我能找到的导致问题的最简单示例: #include #include
我无法弄清楚为什么我的二进制文件无法加载。它是由MATLAB加载的dylib(MEX文件),并链接到位于不同位置的许多dylib。 MATLAB告诉我它无法加载MEX文件,但是我无法弄清它找不到哪个依
我正在尝试让我的程序自动关联要由它打开的某些文件扩展名,但我不确定如何在 MacOSX 中执行此操作。我不是在问如何将程序与 GUI 中的文件扩展名相关联,我希望能够将它编程到我的程序中。 最佳答案
我的应用程序通过我的 mac 上的 nginx 在本地主机端口 80 上运行了很长一段时间。最近我做了一些软件更新,并试图在不同的端口上运行其他应用程序,现在我无法在 localhost:80 上运行
我想用默认的邮件客户端创建一个新邮件并自动附加一个文件。 创建新邮件到 dummy@somewhere.com与主题 foo和 body bar ,我可以执行以下操作: open "mailto:du
我正在使用 MacOS Mojave 版本 10.14.16,我正在尝试安装 http://www.rpl2.net/index.php (一种使用反向波兰表示法的编程语言,可在某些 HP 计算器(如
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我正在尝试为 OS X 构建一个基本的动态库,它只显示一个用于打开文件的对话框。我的代码看起来像这样: NSOpenPanel * dlg = [NSOpenPanel openPanel]; ...
通过应用程序 Utilities/Console.app,我可以看到应用程序的控制台输出。 有没有办法从另一个应用程序访问此日志? 更具体地说:我正在为我的应用程序编写一个崩溃处理程序,我希望它将控制
我最近使用页面 https://github.com/ingenuitas/simplecv 中的 osX-Lion 设置说明安装了 SimpleCV 然后我在终端中输入 python,当我尝试以下操
问题 MacOSX 附带的字典存储在 /Library/Dictionaries 中。我想解析它们以编程方式获取字典结果(通过终端、AppleScript 或 Automator)。这些词典是 Mac
我正在尝试创建一个静态库并将其链接到 MacOS X(几个版本)上: 文件 foo.c : char foo[111]; 文件 bar.c : #include extern char foo[];
我有一个名为 youtube-dl 的命令..但不知道它安装在哪里..我可以从 shell 运行它..我如何找到它的安装位置? youtube-dl 什么也没说.. 最佳答案 Bash 有一个命令可以
我有 macosx,我为 mail.app 创建了一个 html 签名,但是当我发送电子邮件时,有人使用 Windows 属性 font-family 选择它时不起作用。 当我从 MAC 发送到 MA
几个 clGet*Info OpenCL 函数允许 (a) 获取所需信息的大小,或 (b) 信息本身。这在某些情况下是必需的,例如获取设备的名称: char* name; size_t size_of
我在使用 python3 在我的 macosx10.7 上设置 pycharm ide 时遇到了问题。 我已经搜索了所有可用的资源并尝试了数百种方法,此时我必须承认自己的无能并通过此 channel
Environment.OSVersion.Platform 返回一个 PlatformID ( Info: MSDN PlatformID )。 此 PlatformID 的值也可以是“Unix”或
我正在尝试在 Maverick 10.9 的命令行上编译一个项目。该项目在 Linux 上完美编译。显然,MacOSX 上的 ctime 似乎存在问题。错误是 $ make Compiling src
在 Netbeans 使用的 Java 桌面应用程序模板中,菜单栏是使用 JMenuBar 和 JMenuItems 创建的。 我怎样才能让那个栏显示在顶部,菜单栏在 MacOSX 中显示,而不是像在
我正在制作一个自定义窗口(带有 NSBorderlessWindowMask 的 NSWindow)到目前为止,我已经能够处理拖动、调整大小、cmd+单击,甚至在允许的情况下通过双击进行小型化(请参阅
我是一名优秀的程序员,十分优秀!