1

I am using Python 3.6 and I have a strange import error. My Python file contains only the line import formic. But when I execute the script, I get the following error:

from formic import FileSet, Pattern, get_version

ImportError: cannot import name 'FileSet'

I have tried installing Formic both with and without sudo (yes, I know that I shouldn't use pip with sudo, but sometimes you get desperate)

I have used Formic before, but can't figure out what is going on in this situation.

If I only have import sys, then the script runs just fine with no errors, as expected.

Any ideas why this error occurs? Or how to fix it?

Additional Information

export PYTHONPATH=/home/myName/Workspace/myProject/.pyenv/lib/python3.6/site-packages
$ /home/myName/Workspace/myProject/.pyenv/bin/pip3 show formic
    
Name: formic
Version: 0.9b8
Summary: An implementation of Apache Ant FileSet and Globs
Home-page: http://www.aviser.asia/formic
Author: Aviser LLP, Singapore
Author-email: formic@aviser.asia
License: GPLv3+
Location: /home/myName/Workspace/myProject/.pyenv/lib/python3.6/site-packages
Requires: 
Required-by: 

But if I try to import Formic from the same Python, it fails:

$ /home/myName/Workspace/myProject/.pyenv/bin/python

Python 3.6.9 (default, Jun 29 2022, 11:45:57) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import formic
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myName/Workspace/myProject/.pyenv/lib/python3.6/site-packages/formic/__init__.py", line 27, in <module>
    from formic import FileSet, Pattern, get_version
ImportError: cannot import name 'FileSet'
Fred
  • 1,054
  • 1
  • 12
  • 32

1 Answers1

0

The only solution I found was to upgrade to Formic2 and update the code to support it.

Fred
  • 1,054
  • 1
  • 12
  • 32