titipata / pubmed_parser

:clipboard: A Python Parser for PubMed Open-Access XML Subset and MEDLINE XML Dataset
http://titipata.github.io/pubmed_parser/
MIT License
564 stars 164 forks source link

ModuleNotFoundError: No module named 'pubmed_parser' #91

Closed alonasorochynska closed 2 months ago

alonasorochynska commented 4 years ago

I am trying to use your parser but there are some problems. My OS is Windows 10 and I did next steps:

First I try installation from the repo:

pip install git+git://github.com/titipata/pubmed_parser.git

which yields (Successfully installed).

Then I try pip:

pip install pubmed_parser

which yields (Requirement already satisfied)

Then I am running

pytest --cov=pubmed_parser tests/ --verbose 

which yields:

overage.py warning: No data was collected. (no-data-collected)
C:\Users\Alona\pubmed_parser\pubmed_parser\medline_parser.py:470: SyntaxWarning: "is not" with a literal. Did you mean "!="?
 [ref["pmid"] for ref in references if ref["pmid"] is not ""]
C:\Users\Alona\pubmed_parser\pubmed_parser\medline_parser.py:538: SyntaxWarning: "is not" with a literal. Did you mean "!="?
 if author.get("affiliation", "") is not ""

Finally I am going to Jupyter Notebook with: import pubmed_parser as pp (ModuleNotFoundError: No module named 'pubmed_parser')

Then from Jupyter I try:

pip install pubmed_parser

Respond is next: 

ERROR: Could not find a version that satisfies the requirement pubmed_parser (from versions: none) ERROR: No matching distribution found for pubmed_parser



Can you give me any suggestions please how to solve this problem? I was also trying to clone the repository and install parser using pip. The result is same. Thanks in advance!
alonasorochynska commented 4 years ago

Today I have installed everything to the Linux OS and no more problems with pubmed_parser. But I am running the test pytest --cov=pubmed_parser tests/ --verbose and now the respond is: Couldn't parse file pubmed_oa_parser.py. There is a function in this file that doesn't work. Function is list_xml_parser.py(path dir). I am giving the path to the xml file that I want to parse and the output is empty list. Actually doesn't work a list comprehension inside the function:

fullpath = [
        os.path.join(dp, f)
        for dp, dn, fn in os.walk(os.path.expanduser('pubmed20n0173.xml'))
        for f in fn
    ]

It returnes []

Michael-E-Rose commented 5 months ago

Do you still face all these problems?

Michael-E-Rose commented 2 months ago

I think the tests fail because you don't have the necessary test files. And I think the import in jupyter failed because it was using a different python version.