clodius
clodius copied to clipboard
installation issue with python3.6 in conda
pip install clodius installation under conda python3.6 was giving me this (already after conda install pyBigWig):
Collecting clodius==0.7.4
Using cached clodius-0.7.4.tar.gz
Requirement already satisfied: cython in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: numpy in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Collecting negspy (from clodius==0.7.4)
Using cached negspy-0.2.20.tar.gz
Requirement already satisfied: pysam in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: requests in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: h5py in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: pandas in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Collecting slugid (from clodius==0.7.4)
Using cached slugid-1.0.7.tar.gz
Requirement already satisfied: sortedcontainers in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: nose in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Requirement already satisfied: pyBigWig in /home/venevs/miniconda3/lib/python3.6/site-packages (from clodius==0.7.4)
Exception:
Traceback (most recent call last):
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/req/req_set.py", line 666, in _prepare_file
check_dist_requires_python(dist)
File "/home/venevs/miniconda3/lib/python3.6/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File "/home/venevs/miniconda3/lib/python3.6/email/feedparser.py", line 175, in feed
self._input.push(data)
File "/home/venevs/miniconda3/lib/python3.6/email/feedparser.py", line 103, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'
everything worked after manually installing negspy at first: pip install negspy and slugid and forcing clodius to be installed without dependencies:
pip install 'clodius==0.7.4' --force-reinstall --no-deps
I think there's something still wrong when the conda version of pyBigWig is installed. This error is cryptic but it seems to be happening during dependency checking: that's why --no-deps solves it.
From the traceback, I'm guessing that the packaging metadata is corrupted.
Here's the offending source code in pip:
def get_metadata(dist):
if (isinstance(dist, pkg_resources.DistInfoDistribution) and
dist.has_metadata('METADATA')):
return dist.get_metadata('METADATA')
elif dist.has_metadata('PKG-INFO'):
return dist.get_metadata('PKG-INFO')
def check_dist_requires_python(dist):
metadata = get_metadata(dist)
feed_parser = FeedParser()
feed_parser.feed(metadata)
pkg_info_dict = feed_parser.close()
requires_python = pkg_info_dict.get('Requires-Python')
try:
if not check_requires_python(requires_python):
raise exceptions.UnsupportedPythonVersion(
"%s requires Python '%s' but the running Python is %s" % (
dist.project_name,
requires_python,
'.'.join(map(str, sys.version_info[:3])),)
)
except specifiers.InvalidSpecifier as e:
logger.warning(
"Package %s has an invalid Requires-Python entry %s - %s" % (
dist.project_name, requires_python, e))
return
If get_metadata doesn't find a METADATA or PKG-INFO key in the package object, rather than raising an exception, it returns None which makes the feedparser fail. So looks like there's a small bug in pip here: it should raise a useful error about the metadata not being found!
But yeah, something is up with the conda pyBigWig's package metadata. It is either missing or just not getting found by pip. CC @dpryan79
Indeed, no PKG-INFO or METADATA file when installed with conda:
ll /home/nezar/miniconda3/lib/python3.6/site-packages/pyBigWig-0.3.11-py3.6-linux-x86_64.egg-info/
total 24
drwxrwxr-x 2 nezar nezar 4096 Mar 17 22:24 ./
drwxrwxr-x 177 nezar nezar 12288 Mar 17 22:24 ../
-rw-rw-r-- 2 nezar nezar 41 Mar 6 08:40 native_libs.txt
-rw-rw-r-- 2 nezar nezar 1 Mar 6 08:40 not-zip-safe
When installed via pip:
ll ~/miniconda3/lib/python3.6/site-packages/pyBigWig-0.3.11.dist-info/
total 44
drwxrwxr-x 2 nezar nezar 4096 Mar 18 00:45 ./
drwxrwxr-x 177 nezar nezar 12288 Mar 18 00:45 ../
-rw-rw-r-- 1 nezar nezar 10 Mar 18 00:45 DESCRIPTION.rst
-rw-rw-r-- 1 nezar nezar 4 Mar 18 00:45 INSTALLER
-rw-rw-r-- 1 nezar nezar 481 Mar 18 00:45 METADATA
-rw-rw-r-- 1 nezar nezar 679 Mar 18 00:45 metadata.json
-rw-rw-r-- 1 nezar nezar 1113 Mar 18 00:45 RECORD
-rw-rw-r-- 1 nezar nezar 22 Mar 18 00:45 top_level.txt
-rw-rw-r-- 1 nezar nezar 104 Mar 18 00:45 WHEEL
Sorry about that, I have a PR on bioconda now that should fix things. I'll merge it once I'm in the office tomorrow.
My PR is now merged and a new version should be available in bioconda in a few hours. If it's still not working correctly then please let me know.