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

Import refextract fails #57

Open
Omar-Aboelsoud opened this issue Apr 10, 2018 · 15 comments
Open

Import refextract fails #57

Omar-Aboelsoud opened this issue Apr 10, 2018 · 15 comments

Comments

@Omar-Aboelsoud
Copy link

I am trying to import refextract using python 2 and python 3 both fails . It shows the error below .
image
I installed it using pip install refextract as mentioned in readme file

@openp2pdesign
Copy link

Which OS are you using? On Mac you can solve this with brew install libmagic

@Omar-Aboelsoud
Copy link
Author

@openp2pdesign I am using windows , I installed it using Anaconda with pip install command , but It fail when I import it

@Nihabr
Copy link

Nihabr commented Aug 6, 2018

Im having a similar issue when importing refextract, however mine does not appear to be libmagic related:
refextract error

Im using python 3.6.5 on Windows 10, and refextract was installed using pip.

The import code is the same as in the project description example: from refextract import extract_references_from_file

@bastiankayser
Copy link

Same here, Python 3.6.3 on Windows 10, refextract was installed using pip.
from refextract import extract_references_from_file
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\BKY\AppData\Roaming\Python\Python36\site-packages\refextract_init_.py", line 28, in
from .references.api import (
File "C:\Users\BKY\AppData\Roaming\Python\Python36\site-packages\refextract\references\api.py", line 96
raise FullTextNotAvailableError(u"URL not found: '{0}'".format(url)), None, sys.exc_info()[2]
^
SyntaxError: invalid syntax

@srbhp
Copy link

srbhp commented Dec 8, 2018

This also happens in Linux(Debian). Install it using pip3.

Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.

from refextract import extract_references_from_file
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/refextract/init.py", line 28, in
from .references.api import (
File "/usr/local/lib/python3.5/dist-packages/refextract/references/api.py", line 96
raise FullTextNotAvailableError(u"URL not found: '{0}'".format(url)), None, sys.exc_info()[2]
^
SyntaxError: invalid syntax
exit()

@RaymondCui21
Copy link

Same here, Python 2.7 on Windows 7, refextract was installed using pip.
Errors from Pycharm:
File "C:~\venv\2.7\lib\site-packages\magic.py", line 181, in
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation

@RaymondCui21
Copy link

Could the developers provide more workable environment details to repeat the processes, such as OS, Python versions, IDE? Many thanks.

@pHequals7
Copy link

Is the project even maintained? Have the same importing error throws out invalid syntax error. Please solve it ASAP

@patel-zeel
Copy link

This works for me on python 3.6 on colab.

sudo apt-get install -y python-magic

@michamos
Copy link
Contributor

The previous version was not compatible with Python 3. Version 1.* is Python 3 only.

@AxelBerres
Copy link

you need to install the related magic bin package

@kingsj0405
Copy link

I'm failing without any exception...

>python
Python 3.8.2 (default, May  6 2020, 09:02:42) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from refextract import extract_references_from_url
# Just die without logging
>

@walter-hernandez
Copy link

For anyone experiencing this issue, this happens because you need to have magic-bin installed. Then, the solution is:

pip install python-magic-bin

@shreyashgupta68
Copy link

I have already installed the magic bin still getting the same error.

@josePereiro
Copy link

josePereiro commented Jan 22, 2022

For anyone experiencing this issue, this happens because you need to have magic-bin installed. Then, the solution is:

pip install python-magic-bin

This just worked for me Python 3.8.5 refextract 1.1.4

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

No branches or pull requests