matkapi / postpy2

Postman collection runner library for python
Other
35 stars 15 forks source link

ImportError: failed to find libmagic. Check your installation #20

Open double77 opened 1 year ago

double77 commented 1 year ago

This is my code:

from postpy2.core import PostPython
runner = PostPython('idelium-cl.postman_collection.json')

And this is the error:

python test.py          
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from postpy2.core import PostPython
  File "/Users/idelfuschini/opt/anaconda3/lib/python3.8/site-packages/postpy2/core.py", line 9, in <module>
    from postpy2.extractors import extract_dict_from_raw_headers, extract_dict_from_headers, extract_dict_from_raw_mode_data, format_object, extract_dict_from_formdata_mode_data, exctact_dict_from_files
  File "/Users/idelfuschini/opt/anaconda3/lib/python3.8/site-packages/postpy2/extractors.py", line 3, in <module>
    import magic
  File "/Users/idelfuschini/opt/anaconda3/lib/python3.8/site-packages/magic/__init__.py", line 209, in <module>
    libmagic = loader.load_lib()
  File "/Users/idelfuschini/opt/anaconda3/lib/python3.8/site-packages/magic/loader.py", line 49, in load_lib
    raise ImportError('failed to find libmagic.  Check your installation')
ImportError: failed to find libmagic.  Check your installation

we have installed libmagic, pyhton-magic and on my mac I have install libmagic via brew

paramun commented 1 year ago

Can you try install via pip after created virtual environment? Like

python3 -m venv venv
source venv/bin/activate
pip install python-libmagic
python3 test.py
vtwoptwo commented 1 month ago

ERROR: Failed building wheel for cffi Failed to build cffi

is what I get