bndr / pycycle

Tool for pinpointing circular imports in Python. Find cyclic imports in any project
MIT License
333 stars 24 forks source link

Not working on py3 project #11

Open ghost opened 5 years ago

ghost commented 5 years ago

suiwenfeng@anonymous:~/project/xxx$ pycycle --here Parsing of file failed: /home/suiwenfeng/project/xxx/rebuild_img_test.py Parsing of file failed: /home/suiwenfeng/project/xxx/tests/test_build_util.py Parsing of file failed: /home/suiwenfeng/project/xxx/jobs/rebuild_all.py There were errors during the operation, perhaps you are trying to parse python 3 project, with python 2 version of the script? (or vice versa) Project successfully transformed to AST, checking imports for cycles.. Cycle Found :(

Finished.

grabear commented 5 years ago

I just got this same error.

xaqbr commented 5 years ago

Uninstall your current pycycle with pip uninstall pycycle, then try using pip3 install pycycle.

networkingguru commented 4 years ago

I'm getting the same error. Fraedon's suggestion just results in the same error after installation.

DomHudson commented 4 years ago

What is the code in those files? What's the smallest amount of code that causes the error?

ra-coder commented 4 years ago

For me problem was in different python3.* versions

pycycle was for python3.5 and code was for python3.7

I think, good idea to add python version to output pycycle --version and ability to run with proper python via command python3.7 -m pycycle --here like it works for -m pip and -m piptools

HumanBot000 commented 2 days ago

python3.7 -m pycycle --here

No module named pycycle.main; 'pycycle' is a package and cannot be directly executed