英文:
I can't install pip mysql-connector
问题
以下是您提供的文本的中文翻译:
(venv) PS C:\Users\beek6\PycharmProjects\Projects> pip install mysql-connector
正在收集 mysql-connector
使用缓存的 mysql-connector-2.2.9.tar.gz(11.9 MB)
准备元数据(setup.py)... 错误
错误:subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ 退出代码:1
╰─> [38 行输出]
警告:“keywords”应该是一个列表,而不是元组类型
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\beek6\AppData\Local\Temp\pip-install-_ck6wv7i\mysql-connector_785864700b6f4aa5a9ea85383040de83\setup.py", line 53, in <module>
setup(
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
^^^^^^^^^^^^
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 496, in __init__
_Distribution.__init__(
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 283, in __init__
self.finalize_options()
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 934, in finalize_options
for ep in sorted(loaded, key=by_order):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 933, in <lambda>
loaded = map(lambda e: e.load(), filtered)
^^^^^^^^
File "C:\Users\beek6\AppData\Local\Programs\Python\Python311\Lib\importlib\metadata\__init__.py", line 202, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\beek6\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(venv) PS C:\Users\beek6\PycharmProjects\Projects>
请注意,我已经按照您的要求只提供了翻译部分,不包含其他内容。
英文:
(venv) PS C:\Users\beek6\PycharmProjects\Projects> pip install mysql-connector
Collecting mysql-connector
Using cached mysql-connector-2.2.9.tar.gz (11.9 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
Warning: 'keywords' should be a list, got type 'tuple'
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\beek6\AppData\Local\Temp\pip-install-_ck6wv7i\mysql-connector_785864700b6f4aa5a9ea85383040de83\setup.py", line 53, in <module>
setup(
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
^^^^^^^^^^^^
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 496, in __init__
_Distribution.__init__(
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 283, in __init__
self.finalize_options()
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 934, in finalize_options
for ep in sorted(loaded, key=by_order):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\setuptools\dist.py", line 933, in <lambda>
loaded = map(lambda e: e.load(), filtered)
^^^^^^^^
File "C:\Users\beek6\AppData\Local\Programs\Python\Python311\Lib\importlib\metadata\__init__.py", line 202, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\beek6\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(venv) PS C:\Users\beek6\PycharmProjects\Projects>
答案1
得分: 0
问题与 mysql-connector
无关。您已在Windows上安装了 py2app
,但 https://pypi.org/project/py2app/ 仅适用于Mac OS X。卸载 py2app
:
pip uninstall -y py2app
或删除目录 C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app
。
英文:
The problem is not related to mysql-connector
. You have installed py2app
on your Windows but https://pypi.org/project/py2app/ is only for Mac OS X. Uninstall py2app
:
pip uninstall -y py2app
or remove the directory C:\Users\beek6\PycharmProjects\Projects\venv\Lib\site-packages\py2app
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论