Technologicat / pyan

Static call graph generator. The official Python 3 version. Development repo.
GNU General Public License v2.0
324 stars 57 forks source link

Installation fails: conda, pip, Python 2 #13

Closed Uiuran closed 5 years ago

Uiuran commented 5 years ago
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-req-build-PPzXEv/setup.py", line 97
    print("WARNING: Version information not found in '%s', using placeholder '%s'" % (init_py_path, version), file=sys.stderr)
                                                                                                                  ^
SyntaxError: invalid syntax
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-PPzXEv/

Pip 19.1.1 Conda 4.6.14

Technologicat commented 5 years ago

Ok. What is the Python version?

Uiuran commented 5 years ago

2.7.16

On Wed, Jul 24, 2019 at 4:43 PM Juha Jeronen notifications@github.com wrote:

Ok. What is the Python version?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Technologicat/pyan/issues/13?email_source=notifications&email_token=AAOOCX5PEJ6T5KRUZXZ6PJ3QBCWGVA5CNFSM4IGR6IH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2XM46A#issuecomment-514772600, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOOCX7LQX52D4GZAUYWK4DQBCWGVANCNFSM4IGR6IHQ .

Technologicat commented 5 years ago

Ah, that explains it. The Pyan package in PyPI requires Python 3 (tested on 3.4 and 3.6). It also only analyzes Python 3 code.

This is because support for Python 2 will in any case end on January 1, 2020. The compiler interface in the standard library is quite different between Python 2 and 3, so when I added Python 3 support to Pyan, Python 2 support unfortunately had to go.

For analyzing Python 2 code, you can use the final version of Pyan for Python 2, archived in @davidfraser's repo:

https://github.com/davidfraser/pyan/tree/pre-python3

It's just a single .py file, needs no installation. If you'd like to have a pyan command, like in the new version: copy pyan.py to somewhere along your PATH, rename that copy as just pyan (no .py), and then chmod +x pyan it to mark it as executable.