imperva / incapsula-logs-downloader

A Python script for downloading log files from Incapsula
MIT License
30 stars 35 forks source link

module 'M2Crypto' has no attribute 'RSA' #74

Closed paulosuhanov closed 9 months ago

paulosuhanov commented 9 months ago

Hello Everyone, I would like your support, to be able to resolve the error messages that are appearing when I try to run LogsDownloader.py, when I start it generates an error message, and when I look at the logs it says that there is no RSA attribute in the M2Crypto module.

All requirements are installed in the required versions.

Could you help me if I'm doing something wrong or using the wrong versions of OS or Python?

Screenshot 2023-12-13 at 09 41 45 Screenshot 2023-12-13 at 09 42 32
AaronSeibert commented 9 months ago

Can you run the following in a python3 shell using the same environment?

>>> from importlib.metadata import M2Crypto
>>> version('M2Crypto')
khos77 commented 9 months ago

I am having this same issue. I've run the from importlib.metadata import M2Crypto command and it appears M2Crypto isn't part of the importlib.metadata library

dir(importlib.metadata) ['ConfigParser', 'Distribution', 'DistributionFinder', 'EntryPoint', 'FastPath', 'FileHash', 'MetaPathFinder', 'MetadataPathFinder', 'Package NotFoundError', 'PackagePath', 'PathDistribution', 'Prepared', 'all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'spec', 'abc', 'collections', 'csv', 'distribution', 'distributions', 'email', 'entry_points', 'files', 'funct ools', 'import_module', 'io', 'itertools', 'metadata', 'operator', 'os', 'pathlib', 'posixpath', 're', 'requires', 'starmap', 'suppress', 'sy s', 'version', 'zipfile']

joeymoore commented 9 months ago

@khos77 and @paulosuhanov I just merged a new fix for this, please test.

paulosuhanov commented 9 months ago

from importlib.metadata import M2Crypto

Hi @AaronSeibert ,

I tried to do the test you requested, but it generates an error, as if the Module did not exist. It also generates an error when I check the version of the M2Crypto package, but it does not generate an error when I import it.

I checked the PIP and it is installed.

Attached screenshot. Screenshot 2023-12-15 at 11 18 24

paulosuhanov commented 9 months ago

@khos77 ,

Thanks for the fix, I updated it and it's working perfectly.

Thank you very much!