mwisslead/vfp2py

AttributeError: module 'isort' has no attribute 'SortImports'

GirishKumarSharma opened this issue · 2 comments

(base) girish@girish-System-Product-Name:~/Downloads/vfp2py-master$ vfp2py area.prg area.py
Traceback (most recent call last):
File "/home/girish/anaconda3/bin/vfp2py", line 33, in <module>
sys.exit(load_entry_point('vfp2py==0.1.0', 'console_scripts', 'vfp2py')())
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/__main__.py", line 28, in main
vfp2py.convert_file(args.infile, args.outpath, encoding=args.encoding)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py.py", line 536, in convert_file
output = prg2py_after_preproc(data, 'prg', os.path.splitext(os.path.basename(infile))[0])
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py.py", line 481, in prg2py_after_preproc
output_tree = PythonConvertVisitor(input_filename).visit(tree)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py_convert_visitor.py", line 143, in visit
return super(type(self), self).visit(ctx)
File "/home/girish/anaconda3/lib/python3.8/site-packages/antlr4_python3_runtime-4.8-py3.8.egg/antlr4/tree/Tree.py", line 34, in visit
return tree.accept(self)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/VisualFoxpro9Parser.py", line 2305, in accept
return visitor.visitPrg(self)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py_convert_visitor.py", line 186, in visitPrg
imports = isort.SortImports(file_contents='\n'.join(set(self.imports)), line_length=100000).output.splitlines()
AttributeError: module 'isort' has no attribute 'SortImports'
(base) girish@girish-System-Product-Name:~/Downloads/vfp2py-master$ ls
total 76K
drwx------ 2 girish girish 4.0K Dec 16 2020 vfp2py
-rw-rw-r-- 1 girish girish 45 Dec 16 2020 test.h
drwx------ 2 girish girish 4.0K Dec 16 2020 testbed
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 setup.py
-rw-rw-r-- 1 girish girish 1.8K Dec 16 2020 README.md
-rw-rw-r-- 1 girish girish 565 Dec 16 2020 Makefile
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 LICENSE
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 .gitignore
drwx------ 2 girish girish 4.0K Dec 16 2020 extras
drwxr-xr-x 28 girish girish 20K Oct 15 17:42 ..
drwxrwxr-x 2 girish girish 4.0K Oct 15 17:42 vfp2py.egg-info
drwxrwxr-x 4 girish girish 4.0K Oct 15 17:42 build
drwxrwxr-x 2 girish girish 4.0K Oct 15 17:42 dist
-rwxrwxr-x 1 girish girish 1.2K Oct 15 17:48 area.prg
drwx------ 8 girish girish 4.0K Oct 15 17:48 .

I downloaded the zip and follow the python3 setup.py install, all went fine but when I tried to convert a .prg to .py, I got above error.

You need a version of isort less than 5 as is set in the setup.py install_requires.

I am not able to uninstall isort.

(base) girish@girish-System-Product-Name:~$ sudo apt-get purge --auto-remove isort
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'isort' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
(base) girish@girish-System-Product-Name:~$ isort --version
` _ _` ` (_) ___ ___ _ __| |_` ` | |/ _/ / _ \/ '__ _/` ` | |\__ \/\_\/| | | |_` ` |_|\___/\___/\_/ \_/`
isort your imports, so you don't have to.
``
VERSION 5.9.3
Even isort is available when I press tab key after typing iso.