Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when importing eml_parser #14

Closed
bcalisch opened this issue Nov 21, 2017 · 6 comments
Closed

Error when importing eml_parser #14

bcalisch opened this issue Nov 21, 2017 · 6 comments
Assignees
Labels

Comments

@bcalisch
Copy link

Hello. This is my first time making an issue, so be easy on me. I have tried importing eml_parser on 3.6.1, 3.6.2, and 3.6.3 and when I import eml_parser I get an error. I posted the error below. Any help would be greatly appreciated.

Traceback (most recent call last):
File "getError.py", line 5, in
import eml_parser
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\eml_parser_init_.py", line 8, in
from . import eml_parser
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\eml_parser\eml_parser.py", line 63, in
import magic
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\magic.py", line 23, in
_libraries['magic'] = _init()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\magic.py", line 20, in init
return ctypes.cdll.LoadLibrary(find_library('magic'))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\ctypes_init
.py", line 426, in LoadLibrary
return self.dlltype(name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\ctypes_init
.py", line 348, in init
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None

@sim0nx sim0nx self-assigned this Nov 23, 2017
@sim0nx
Copy link
Member

sim0nx commented Nov 23, 2017

Hi,

I must admit that I have never tried eml_parser on windows. My guess is that you don't have the "magic" library installed (in addition to the python lib).

See the windows dependencies on https://github.com/ahupp/python-magic (not the library required for eml_parser but same windows deps).

Let me know if this works for you.

@Foxdelmar
Copy link

I have the same error. Windows 10, Python 3.6.3
I installed magic using: pip install libmagic

I found a few threads that discuss similar errors. For example pymedusa/Medusa#1843
This and other threads refer to the following bug: http://bugs.python.org/issue29082 which exists for more then one year. But with my knowledge I can not find a solution to solve this issue.

Do you have any clue?

@sim0nx
Copy link
Member

sim0nx commented Jan 21, 2018

I'm sorry but I can't really help you with Windows problems here besides the link I posted earlier :-/
If you don't necessarily need mime parsing support, give it a try without the mime library.

@sal-git
Copy link

sal-git commented Feb 1, 2018

I submitted a pull request with the fix. It works on my machine now.

Check if it is a windows machine and if it is, use libmagic

@sim0nx
Copy link
Member

sim0nx commented Feb 3, 2018

Unfortunately as noted in the PR #16 , that is not a valid fix.
You must either remove the file-magic python library or properly install libmagic DLL.

@sim0nx sim0nx closed this as completed Feb 3, 2018
@alexander-gr
Copy link

I've just installed python-magic:
pip install python-magic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants