hoffmangroup / genomedata

The Genomedata format for storing large-scale functional genomics data.
https://genomedata.hoffmanlab.org/
GNU General Public License v2.0
2 stars 1 forks source link

pip install --upgrade genomedata can fail on some systems, due to path.py issues #50

Open EricR86 opened 5 years ago

EricR86 commented 5 years ago

Original report (archived issue) by Coby Viner (Bitbucket: cviner2, GitHub: cviner).


On Graham, I had version 1.3.6 installed via pip install --user genomedata.

Upon upgrading, via pip install --user --upgrade genomedata, to version 1.4.4, I was no longer able to use genomedata, obtaining:

#!text

Traceback (most recent call last):
  File "../../src/cytomod.py", line 673, in <module>
    from genomedata import Genome, load_genomedata
  File "/home/cviner2/.local/lib/python2.7/site-packages/genomedata/__init__.py", line 29, in <module>
    from path import path
ImportError: cannot import name path

This occurred with path.py 11.5.0, which was automatically installed. Downgrading to version 8.2.1 restored functionality, at least with respect to this single command. Uninstalling and reinstalling path.py manually, to the latest version (11.5.0) also appeared to resolve this, but other modules may have been upgraded in between doing so (unfortunately I cannot reproduce this part).

Relatedly, something similar appears to be a common issue with path.py, though not directly involving these versions or workflow. It might be a good idea to (somehow) force a reinstall of path.py or perhaps just to document this as a potential issue with the above possible solution?

EricR86 commented 5 years ago

Original comment by Eric Roberts (Bitbucket: ericr86, GitHub: ericr86).


This is because of the package 'forked-path' being installed on systems. Newer versions of Genomedata use the "correct" package path.py (not an old "forked" version). Both python packages are named "path" and can conflict with each other. It's important to move away from "forked-path" but the fact that this package will remain on systems unless a clean environment is used or a forced uninstall happens is a problem I'm not sure how to work around.

There's unfortunately no good upgrade solution that I know of and all suggestions would be welcome. When upgrading, removing "forked-path" from your python packages should alleviate your issues.

EricR86 commented 5 years ago

Original comment by Coby Viner (Bitbucket: cviner2, GitHub: cviner).


Thanks for those details! I don't have a better idea either, except perhaps the genomedata installation checking for and warning about an existing "forked-path" package.

EricR86 commented 5 years ago

Original comment by Michael Hoffman (Bitbucket: hoffman, GitHub: michaelmhoffman).


You should be able to use the pkg_resources module to force specific versions of dependencies at runtime. https://setuptools.readthedocs.io/en/latest/pkg_resources.html