cgat-developers / cgat-apps

cgat-apps repository
Other
33 stars 14 forks source link

pip install cgat does not install dependencies #39

Closed j-berg closed 5 years ago

j-berg commented 5 years ago

It appears the pypi hosted version is not automatically checking for missing dependencies

Here is an example:

jordan-berg:tests jordan$ cgat gtf2gtf
Traceback (most recent call last):
  File "/Users/jordan/miniconda/bin/cgat", line 10, in <module>
    sys.exit(main())
  File "/Users/jordan/miniconda/lib/python3.7/site-packages/cgat/cgat.py", line 129, in main
    module = imp.load_module(command, file, pathname, description)
  File "/Users/jordan/miniconda/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/Users/jordan/miniconda/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/jordan/miniconda/lib/python3.7/site-packages/cgat/tools/gtf2gtf.py", line 285, in <module>
    import cgat.GTF as GTF
  File "/Users/jordan/miniconda/lib/python3.7/site-packages/cgat/GTF.py", line 41, in <module>
    from cgat import IndexedGenome as IndexedGenome
  File "/Users/jordan/miniconda/lib/python3.7/site-packages/cgat/IndexedGenome.py", line 43, in <module>
    import quicksect
ModuleNotFoundError: No module named 'quicksect'

There are several other cases too, such as with cgatcore,cython, and paramiko to name a few

Acribbs commented 5 years ago

Since there is no way for pypi to reliably take into account all the intricacies of the package installation process and determine what they are, our preferred installation is through conda conda install -c bioconda cgat-apps .

j-berg commented 5 years ago

Got it, thanks for the quick response -- unfortunately I was having issues with that too that I'm still trying to work through (I'll attach below incase you're familiar with how to work through it, if not we can close the issue.

jordan-berg:tests jordan$ conda install -c bioconda cgatcore
Collecting package metadata: done
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - clangxx
Use "conda search <package> --info" to see the dependencies for each package
Acribbs commented 5 years ago

Hmm, this error relates to an incomparable version of the clang compiler.

I would install in a clean environment:

conda create -n cgat-env 
conda activate cgat-env
conda install -c bioconda cgat-apps
conda install -c bioconda cgatcore 
j-berg commented 5 years ago

Trying this I get:

jordan-berg:tests jordan$ conda list
# packages in environment at /Users/jordan/miniconda3/envs/cgat_test:
#
# Name                    Version                   Build  Channel
jordan-berg:tests jordan$ conda install -c bioconda cgat-apps
Collecting package metadata: done
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - cgat-apps
Use "conda search <package> --info" to see the dependencies for each package.

I tried installing cgatcore first, which works, but then shows the same error when trying to install cgat-apps :/

Acribbs commented 5 years ago

That’s very strange, Cgat-apps is in conflict with Cgat-apps. This indicates that you already have Cgat-apps installed?

I think your pip install Cgat-apps may be in conflict with the conda, can you pip uninstall Cgat-apps first?

j-berg commented 5 years ago

I tried, but with the same result unfortunately. I uninstalled any mention of a cgat app from pip and conda, tried running the previous install commands and its still citing a conflict. Also tried hunting through directories where a pip or conda install may have deposited something but not properly disposed of during uninstall and still nothing.

Acribbs commented 5 years ago

Any suggestions @sebastian-luna-valero.

There is something very strange with your environment. What system are you installing into?

How about manually installing by:

git clone https://github.com/cgat-developers/cgat-apps.git
cd cgat-apps
python setup install

cgat --help

Then you will have to install the missing dependancies as an when you require them through conda conda install <package>.

Alternatively, we have an installation script detailed on the README page of cgat-apps.

Acribbs commented 5 years ago

Actually, looking at your error trace, I assume this is OSX? what version are you running?

antoniojbt commented 5 years ago

It might be worth checking again for previous installations if you used python setup install in the past as files need to be removed manually. You may want to use python setup.py install --record files.txt to keep track of what got installed. See this stackoverflow question for example.

sebastian-luna-valero commented 5 years ago

Thanks, All.

@j-berg could you please try this instead:

conda create -n cgat-env -c conda-forge -c bioconda -c defaults --override-channels cgat-apps

If that went well, then the following should work:

conda activate cgat-env
cgat --help

Best regards, Sebastian

j-berg commented 5 years ago

@sebastian-luna-valero I ran the commands you suggested and it looks like everything is working, thanks!