环境:conda python3.10 系统:M1 Mac
输入: pipreqs /Users///fastapi_llama --force pipreqs ./ --encoding=utf8
报错信息: ERROR: Failed on file: ./.conda/lib/python3.1/lib2to3/tests/data/different_encoding.py Traceback (most recent call last): File "/opt/anaconda3/envs/ai_project/bin/pipreqs", line 8, in <module> sys.exit(main()) File "/opt/anaconda3/envs/ai_project/lib/python3.10/site-packages/pipreqs/pipreqs.py", line 609, in main init(args) File "/opt/anaconda3/envs/ai_project/lib/python3.10/site-packages/pipreqs/pipreqs.py", line 533, in init candidates = get_all_imports( File "/opt/anaconda3/envs/ai_project/lib/python3.10/site-packages/pipreqs/pipreqs.py", line 153, in get_all_imports raise exc File "/opt/anaconda3/envs/ai_project/lib/python3.10/site-packages/pipreqs/pipreqs.py", line 139, in get_all_imports tree = ast.parse(contents) File "/opt/anaconda3/envs/ai_project/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "<unknown>", line 3 print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
然后我点开 ./.conda/lib/python3.1/lib2to3/tests/data/different_encoding.py 发现这里面就是乱码: #!/usr/bin/env python print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
def f(x): print '%s\t-> α(%2i):%s β(%s)'
我的问题: 1.无法使用 pipreqs ,有什么解决的办法? 前几天还是用这个导出的 翻了部分 issue 和 google 都没得到解决,所以发帖请教
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.