尝试从Windows设备在Jupyter中安装eralchemy时出错

2024-09-30 16:26:44 发布

您现在位置:Python中文网/ 问答频道 /正文

你好

当我运行命令时 pip安装化学 在一个来自Windows设备的清晰的Jupyter笔记本中,我得到了下面冗长的错误消息。我已经用巧克力安装了Graphviz,用它的构建工具安装了VisualStudio。有什么帮助吗

ERROR: Command errored out with exit status 1: command: 'C:\Users\stanj\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"'; file='"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\stanj\AppData\Local\Temp\pip-wheel-68acdv22' cwd: C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\
Complete output (46 lines): running bdist_wheel running build
running build_py creating build Collecting eralchemy Using cached ERAlchemy-1.2.10-py2.py3-none-any.whl (14 kB) Collecting pygraphviz
Using cached pygraphviz-1.7.zip (118 kB) Requirement already satisfied: SQLAlchemy in c:\users\stanj\anaconda3\lib\site-packages (from eralchemy) (1.3.18) Building wheels for collected packages: pygraphviz Building wheel for pygraphviz (setup.py): started
Building wheel for pygraphviz (setup.py): finished with status 'error' Running setup.py clean for pygraphviz Failed to build pygraphviz Installing collected packages: pygraphviz, eralchemy Running setup.py install for pygraphviz: started Running setup.py install for pygraphviz: finished with status 'error' creating build\lib.win-amd64-3.8 creating build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\agraph.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\scraper.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\testing.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz_init_.py -> build\lib.win-amd64-3.8\pygraphviz creating build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_close.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_scraper.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests_init_.py -> build\lib.win-amd64-3.8\pygraphviz\tests running egg_info writing pygraphviz.egg-info\PKG-INFO writing dependency_links to pygraphviz.egg-info\dependency_links.txt writing top-level names to pygraphviz.egg-info\top_level.txt reading manifest file 'pygraphviz.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.png' under directory 'doc' warning: no files found matching '.txt' under directory 'doc' warning: no files found matching '.css' under directory 'doc' warning: no previously-included files matching '~' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.svn' found anywhere in distribution no previously-included directories found matching 'doc\build' writing manifest file 'pygraphviz.egg-info\SOURCES.txt' copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.8\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.8\pygraphviz running build_ext building 'pygraphviz.graphviz' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
---------------------------------------- ERROR: Failed building wheel for pygraphviz ERROR: Command errored out with exit status 1: command: 'C:\Users\stanj\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"'; file='"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\stanj\AppData\Local\Temp\pip-record-v7o_3mbj\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\stanj\anaconda3\Include\pygraphviz' cwd: C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz
Complete output (46 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 creating build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\agraph.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\graphviz.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\scraper.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\testing.py -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz_init
.py -> build\lib.win-amd64-3.8\pygraphviz creating build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_close.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_scraper.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-3.8\pygraphviz\tests copying pygraphviz\tests_init_.py -> build\lib.win-amd64-3.8\pygraphviz\tests running egg_info writing pygraphviz.egg-info\PKG-INFO writing dependency_links to pygraphviz.egg-info\dependency_links.txt writing top-level names to pygraphviz.egg-info\top_level.txt reading manifest file 'pygraphviz.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '
.png' under directory 'doc' warning: no files found matching '.txt' under directory 'doc' warning: no files found matching '.css' under directory 'doc' warning: no previously-included files matching '~' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.svn' found anywhere in distribution no previously-included directories found matching 'doc\build' writing manifest file 'pygraphviz.egg-info\SOURCES.txt' copying pygraphviz\graphviz.i -> build\lib.win-amd64-3.8\pygraphviz copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-3.8\pygraphviz running build_ext building 'pygraphviz._graphviz' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\stanj\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"'; file='"'"'C:\Users\stanj\AppData\Local\Temp\pip-install-pw34pfvb\pygraphviz\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\stanj\AppData\Local\Temp\pip-record-v7o_3mbj\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\stanj\anaconda3\Include\pygraphviz' Check the logs for full command output.


Tags: installnopytestbuildlibtestswin
2条回答

这应该起作用:

pip install upgrade no-deps git+https://github.com/psychemedia/eralchemy.git

宾果!它与GoogleColab合作。谢谢大家的贡献

以下是我在您的帮助下遵循的步骤:

  1. 我用Google Colab打开了笔记本
  2. 我将数据库和csv文件保存在Google Colab的content文件夹中
  3. 我按照建议运行了以下命令:

pip install upgrade no-deps git+https://github.com/psychemedia/eralchemy.git

  1. 我从埃拉切米进口了渲染器

from eralchemy import render_er

  1. 我从数据库中提取了

render_er("sqlite:///relative_path_to_db.db", 'erd_from_sqlite.png')

  1. 还有塔达!它显示了我在Google Colab中数据库的ER图

接下来的问题是:既然我们知道了如何在GoogleColab中使用它,有人能想出如何在Jupyter中使用它吗

相关问题 更多 >