pubmed_parser icon indicating copy to clipboard operation
pubmed_parser copied to clipboard

ModuleNotFoundError: No module named 'pubmed_parser'

Open alonasorochynska opened this issue 5 years ago • 2 comments

I am trying to use your parser but there are some problems. My OS is Windows 10 and I did next steps: I installed Git. From Git I run: $ pip install git+git://github.com/titipata/pubmed_parser.git (Successfully installed). From git:

$ pip install pubmed_parser (Requirement already satisfied).

Then I am running

$ pytest --cov=pubmed_parser tests/ --verbose 

With next problem:

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 avatar Jul 13 '20 11:07 alonasorochynska

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 []

alonasorochynska avatar Jul 14 '20 11:07 alonasorochynska

Do you still face all these problems?

Michael-E-Rose avatar Feb 11 '24 13:02 Michael-E-Rose

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.

Michael-E-Rose avatar May 16 '24 10:05 Michael-E-Rose