glato / emerge

Emerge is a browser-based interactive codebase and dependency visualization tool for many different programming languages. It supports some basic code quality and graph metrics and provides a simple and intuitive way to explore and analyze a codebase by using graph structures.
MIT License
783 stars 46 forks source link

[BUG] Cannot install from git repo #39

Closed Kochise closed 1 year ago

Kochise commented 1 year ago

Windows 10 AMD64 20H2 Python

Running "C:\Users\User\AppData\Local\Temp\pyrun.bat.9590\pyrun.bat" :
cd=h:\_TST\wm_lng_python__emerge
PIP_PROX=--proxy="http://gateway.schneider.zscaler.net:80"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2518k  100 2518k    0     0   753k      0  0:00:03  0:00:03 --:--:--  754k
Installing "https://bootstrap.pypa.io/get-pip.py"...
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Collecting setuptools
  Using cached setuptools-67.7.2-py3-none-any.whl (1.1 MB)
Collecting wheel
  Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
Installing collected packages: wheel, setuptools, pip
Successfully installed pip-23.1.2 setuptools-67.7.2 wheel-0.40.0

 - - - Installing "pip" - - - - - - - - - - - - - - - - - - - - - - - -

 - - - Installing "git+https://github.com/glato/emerge.git" - - - - - - - - - - - - - - - - - - - - - - - -

Collecting git+https://github.com/glato/emerge.git
  Running command git clone --filter=blob:none --quiet https://github.com/glato/emerge.git 'C:\Users\User\AppData\Local\Temp\pip-req-build-9c3tn3wg'
  Cloning https://github.com/glato/emerge.git to c:\users\user\appdata\local\temp\pip-req-build-9c3tn3wg
  Resolved https://github.com/glato/emerge.git to commit 9af6d63e278e7c405180322794e459588d353cde
  Preparing metadata (setup.py): started
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\User\AppData\Local\Temp\pip-req-build-9c3tn3wg\setup.py", line 13, in <module>
          README = (HERE / "README.md").read_text()
        File "h:\_TST\wm_lng_python__emerge\Python\Lib\pathlib.py", line 1135, in read_text
          return f.read()
        File "h:\_TST\wm_lng_python__emerge\Python\Lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2196: character maps to <undefined>
      [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.
  Preparing metadata (setup.py): finished with status 'error'

Installation done...
Running default "pyrun.py"...
h:\_TST\wm_lng_python__emerge\Python\python: can't open file 'h:\\_TST\\wm_lng_python__emerge\\pyrun.py': [Errno 2] No such file or directory

h:\_TST\wm_lng_python__emerge>python --version
Python 3.10.8

h:\_TST\wm_lng_python__emerge>

Works with regular pip install emerge-viz but is a bit "old".

Kochise commented 1 year ago

Installing from pip I get this :

 - - - Installing "emerge-viz" - - - - - - - - - - - - - - - - - - - - - - - -

Collecting emerge-viz
  Downloading emerge_viz-1.5.0-py3-none-any.whl (1.1 MB)
     ---------------------------------------- 1.1/1.1 MB 1.6 MB/s eta 0:00:00
Collecting autopep8 (from emerge-viz)
  Downloading autopep8-2.0.2-py2.py3-none-any.whl (45 kB)
     ---------------------------------------- 45.2/45.2 kB 1.1 MB/s eta 0:00:00
Collecting interrogate (from emerge-viz)
  Downloading interrogate-1.5.0-py3-none-any.whl (45 kB)
     ---------------------------------------- 45.3/45.3 kB ? eta 0:00:00
Collecting networkx (from emerge-viz)
  Downloading networkx-3.1-py3-none-any.whl (2.1 MB)
     ---------------------------------------- 2.1/2.1 MB 2.6 MB/s eta 0:00:00
Collecting scikit-learn (from emerge-viz)
  Downloading scikit_learn-1.2.2-cp310-cp310-win_amd64.whl (8.3 MB)
     ---------------------------------------- 8.3/8.3 MB 2.9 MB/s eta 0:00:00
Collecting prettytable (from emerge-viz)
  Downloading prettytable-3.7.0-py3-none-any.whl (27 kB)
Collecting py (from emerge-viz)
  Downloading py-1.11.0-py2.py3-none-any.whl (98 kB)
     ---------------------------------------- 98.7/98.7 kB ? eta 0:00:00
Collecting pygraphviz (from emerge-viz)
  Downloading pygraphviz-1.10.zip (120 kB)
     -------------------------------------- 120.6/120.6 kB 3.6 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pylint (from emerge-viz)
  Downloading pylint-2.17.4-py3-none-any.whl (536 kB)
     -------------------------------------- 536.6/536.6 kB 2.8 MB/s eta 0:00:00
Collecting pyparsing (from emerge-viz)
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ---------------------------------------- 98.3/98.3 kB 5.5 MB/s eta 0:00:00
Collecting python-louvain (from emerge-viz)
  Downloading python-louvain-0.16.tar.gz (204 kB)
     -------------------------------------- 204.6/204.6 kB 4.2 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting tabulate (from emerge-viz)
  Downloading tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting astroid<=2.17.0-dev0,>=2.15.4 (from pylint->emerge-viz)
  Downloading astroid-2.15.4-py3-none-any.whl (278 kB)
     -------------------------------------- 278.1/278.1 kB 2.9 MB/s eta 0:00:00
Collecting tomlkit>=0.10.1 (from pylint->emerge-viz)
  Downloading tomlkit-0.11.8-py3-none-any.whl (35 kB)
Collecting dill>=0.2 (from pylint->emerge-viz)
  Downloading dill-0.3.6-py3-none-any.whl (110 kB)
     -------------------------------------- 110.5/110.5 kB 2.1 MB/s eta 0:00:00
Collecting scipy>=1.3.2 (from scikit-learn->emerge-viz)
  Downloading scipy-1.10.1-cp310-cp310-win_amd64.whl (42.5 MB)
     ---------------------------------------- 42.5/42.5 MB 1.9 MB/s eta 0:00:00
Collecting joblib>=1.1.1 (from scikit-learn->emerge-viz)
  Downloading joblib-1.2.0-py3-none-any.whl (297 kB)
     -------------------------------------- 298.0/298.0 kB 2.3 MB/s eta 0:00:00
Collecting threadpoolctl>=2.0.0 (from scikit-learn->emerge-viz)
  Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting lazy-object-proxy>=1.4.0 (from astroid<=2.17.0-dev0,>=2.15.4->pylint->emerge-viz)
  Downloading lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl (22 kB)
Collecting wrapt<2,>=1.11 (from astroid<=2.17.0-dev0,>=2.15.4->pylint->emerge-viz)
  Downloading wrapt-1.15.0-cp310-cp310-win_amd64.whl (36 kB)
Building wheels for collected packages: pygraphviz, python-louvain
  Building wheel for pygraphviz (setup.py): started
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  ¦ exit code: 1
  ?-> [52 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\agraph.py -> build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\graphviz.py -> build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\scraper.py -> build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\testing.py -> build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\__init__.py -> build\lib.win-amd64-cpython-310\pygraphviz
      creating build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_clear.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_close.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_drawing.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_graph.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_html.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_layout.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_node_attributes.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_readwrite.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_repr_mimebundle.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_scraper.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_string.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_subgraph.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\test_unicode.py -> build\lib.win-amd64-cpython-310\pygraphviz\tests
      copying pygraphviz\tests\__init__.py -> build\lib.win-amd64-cpython-310\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'
      adding license file 'LICENSE'
      writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
      copying pygraphviz\graphviz.i -> build\lib.win-amd64-cpython-310\pygraphviz
      copying pygraphviz\graphviz_wrap.c -> build\lib.win-amd64-cpython-310\pygraphviz
      running build_ext
      building 'pygraphviz._graphviz' extension
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      creating build\temp.win-amd64-cpython-310\Release\pygraphviz
      cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DSWIG_PYTHON_STRICT_BYTE_CHAR -DGVDLL -Ih:\_TST\wm_lng_python__emerge\b\Python\include -Ih:\_TST\wm_lng_python__emerge\b\Python\Include /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-cpython-310\Release\pygraphviz/graphviz_wrap.obj
      error: command 'cl.exe' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygraphviz
  Building wheel for pygraphviz (setup.py): finished with status 'error'
  Running setup.py clean for pygraphviz
  Building wheel for python-louvain (setup.py): started
  Building wheel for python-louvain (setup.py): finished with status 'done'
  Created wheel for python-louvain: filename=python_louvain-0.16-py3-none-any.whl size=9403 sha256=4ea0f9bc163df04407b54569785c213906582a62984164a0a9816bfa2dbdb17e
ERROR: Could not build wheels for pygraphviz, which is required to install pyproject.toml-based projects
  Stored in directory: :\Users\User\AppData\Local\Temp\pip-ephem-wheel-cache-zdh7onix\wheels\d0\b0\d7\6dd26c3817810fa379088eaeb755a01d9a2a411c37632079d1
Successfully built python-louvain
Failed to build pygraphviz
Kochise commented 1 year ago

Have to run first :

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat

But https://github.com/pygraphviz/pygraphviz fails anyway as https://graphviz.org/download/source/ is not present.

Plus that include files are not to be inside subfolders but directly into ./Python/include/graphviz.

Kochise commented 1 year ago

Ok, it's a pygraphviz bug since they do not provide wheels for Windows 10 AMD64 :

https://github.com/pygraphviz/pygraphviz/issues/197 https://github.com/pygraphviz/pygraphviz/issues/322 https://github.com/pygraphviz/pygraphviz/issues/374 https://github.com/pygraphviz/pygraphviz/issues/445 https://github.com/pygraphviz/pygraphviz/issues/454 https://github.com/pygraphviz/pygraphviz/pull/455 ...

Best option so far is

  1. installing Graphviz : graphviz-8.x.y (64-bit) EXE installer, not the ZIP (:warning: folder structure and files are different)
  2. installing Visual Studio 2022 Community
  3. from the command line, run the following commands in-order :

Not really sure the compilation/linker options are passed through pip so the LIB environment variable is set prior to installation/compilation.

When installation is complete, you can do :

Regards.

glato commented 1 year ago

@Kochise Sounds like you had quite a journey with this issue. Did you manage to get it running eventually?

glato commented 1 year ago

@Kochise Update on this issue: I will probably try to remove the dependency to pygraphviz in the upcoming/next version, since it is causing to much effort related to the setup on Apple Silicon or Windows setups (as mentioned in your issue). The next version of emerge will probably be released in 1-2 weeks (including bugfixes, but hopefully some exciting new features as well).

Kochise commented 1 year ago

Then what are you going to use instead ? D3.js ?

https://github.com/vasturiano/3d-force-graph

glato commented 1 year ago

Already removed pygraphviz locally, was only included for creating DOT files (but haven‘t used this format anyway). Yes, d3js is already the base of emerge‘s web app, this will stay. Next bigger release will be in about a week 🤞.

Kochise commented 1 year ago

Thank you. Removing pygraphviz as being an "unused" dependency will indeed help a lot toward deployment on platforms that have trouble with this package.

Kochise commented 8 months ago

Solved in https://github.com/glato/emerge/releases/tag/2.0.0