CLIPper install problem

119 views
Skip to first unread message

Nick Webster

unread,
Jan 23, 2020, 4:06:01 PM1/23/20
to CLIPper-discuss
Hi,  I was trying to install CLIPper but ran into a problem.   The install gives multiple errors that seem to be related to Py_InitModule.  All dependencies are installed.  The versions of modules are:

python 3.5.6
pysam 0.15.4
numpy 1.17.4
scipy 1.4.1
matplotlib 3.0.3
pybedtools 0.8.1
HTSeq 0.11.2


                       ^

clipper/src/peaksmodule.cc:468:36: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?

      PyList_SetItem(retWiggle, i, PyInt_FromLong(wiggle[i]));

                                   ^~~~~~~~~~~~~~

                                   PyLong_FromLong

/Users/nicholaswebster/anaconda2/envs/py3/include/python3.5m/longobject.h:18:24: note: 'PyLong_FromLong' declared here

PyAPI_FUNC(PyObject *) PyLong_FromLong(long);

                       ^

clipper/src/peaksmodule.cc:471:38: error: use of undeclared identifier 'PyInt_FromLong'; did you mean 'PyLong_FromLong'?

    PyList_SetItem(retPos_counts, i, PyInt_FromLong(pos_counts[i]));

                                     ^~~~~~~~~~~~~~

                                     PyLong_FromLong

/Users/nicholaswebster/anaconda2/envs/py3/include/python3.5m/longobject.h:18:24: note: 'PyLong_FromLong' declared here

PyAPI_FUNC(PyObject *) PyLong_FromLong(long);

                       ^

clipper/src/peaksmodule.cc:455:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long')

      [-Wsign-compare]

  for (int i = 0; i < lengths.size(); i++) {

                  ~ ^ ~~~~~~~~~~~~~~

clipper/src/peaksmodule.cc:464:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long')

      [-Wsign-compare]

  for (int i = 0; i < wiggle.size(); i++) {

                  ~ ^ ~~~~~~~~~~~~~

clipper/src/peaksmodule.cc:498:12: warning: duplicate 'extern' declaration specifier [-Wduplicate-decl-specifier]

extern "C" PyMODINIT_FUNC initpeaks(void) 

           ^

/Users/nicholaswebster/anaconda2/envs/py3/include/python3.5m/pyport.h:784:39: note: expanded from macro 'PyMODINIT_FUNC'

#               define PyMODINIT_FUNC extern "C" PyObject*

                                      ^

clipper/src/peaksmodule.cc:501:3: error: use of undeclared identifier 'Py_InitModule'

  Py_InitModule("peaks", peaks_methods);

  ^

10 warnings and 18 errors generated.

error: command '/usr/bin/clang' failed with exit status 1



Any thoughts?

Nick Webster

unread,
Jan 23, 2020, 4:09:46 PM1/23/20
to CLIPper-discuss
Okay.  

After a little searching I found that Py_InitModule works for python2.x but not for python3.x.  Will try installing with python2.7.  Or is there a python3.x work around?  Python3.x seems to use PyModuleDef instead.

Nick

Nick Webster

unread,
Jan 23, 2020, 4:30:56 PM1/23/20
to CLIPper-discuss
Further complications.  I installed in python 2.7 environment.  Everything seemed to be going fine until RuntimeError: Scikit-learn requires python3.5 or later.  So if Scikit-learn is required by clipper then clipper cannot be run in python2.x.


Gabriel Pratt

unread,
Jan 23, 2020, 4:48:54 PM1/23/20
to Nick Webster, CLIPper-discuss
I know Python2 has been EOLed, but Clipper doesn't currently support Python3.  

We may upgrade in the future, but thats up to the current maintainers, or anyone who feels like making an open source contribution to the tool.

Gabriel Pratt


On Thu, Jan 23, 2020 at 1:30 PM 'Nick Webster' via CLIPper-discuss <clipper...@googlegroups.com> wrote:
Further complications.  I installed in python 2.7 environment.  Everything seemed to be going fine until RuntimeError: Scikit-learn requires python3.5 or later.  So if Scikit-learn is required by clipper then clipper cannot be run in python2.x.


--
You received this message because you are subscribed to the Google Groups "CLIPper-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipper-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipper-discuss/ac3bd9e8-67a3-464a-b91c-4da86df4fa37%40googlegroups.com.

code4DNA

unread,
Jan 23, 2020, 6:37:44 PM1/23/20
to CLIPper-discuss
Hi, I ran into the same issue which was resolved by installing Scikit-learn version 0.18.2 which does support Python2


On Thursday, January 23, 2020 at 3:48:54 PM UTC-6, Gabriel Pratt wrote:
I know Python2 has been EOLed, but Clipper doesn't currently support Python3.  

We may upgrade in the future, but thats up to the current maintainers, or anyone who feels like making an open source contribution to the tool.

Gabriel Pratt


On Thu, Jan 23, 2020 at 1:30 PM 'Nick Webster' via CLIPper-discuss <clipper...@googlegroups.com> wrote:
Further complications.  I installed in python 2.7 environment.  Everything seemed to be going fine until RuntimeError: Scikit-learn requires python3.5 or later.  So if Scikit-learn is required by clipper then clipper cannot be run in python2.x.


--
You received this message because you are subscribed to the Google Groups "CLIPper-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipper...@googlegroups.com.

Nick Webster

unread,
Jan 24, 2020, 2:52:02 PM1/24/20
to CLIPper-discuss
Lastest update:

Had to reinstall pip as it lost PackageFinder.   Then reinstalled numpy, scikit, scipy, and matplotlib.  Scikit-learn is version 0.20.4.  Then ran:

pythonw setup.py install

installation seemed to work (here's the end of the install)

Using /Users/nicholaswebster/anaconda2/lib/python2.7/site-packages

Searching for kiwisolver==1.1.0

Best match: kiwisolver 1.1.0

Adding kiwisolver 1.1.0 to easy-install.pth file


Using /Users/nicholaswebster/anaconda2/lib/python2.7/site-packages

Finished processing dependencies for clipper==0.2.0


webster-imac:clipper nicholaswebster$ cd ..


Then when I ran clipper -h i got 


RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.


So I used conda install to reinstall matplotlib as I read that conda install prevents the framework problems with pip


Now when I run clipper -h I get a different error:


Traceback (most recent call last):

File "/Users/nicholaswebster/anaconda2/bin/clipper", line 11, in <module>

    load_entry_point('clipper==0.2.0', 'console_scripts', 'clipper')()

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point

    return get_distribution(dist).load_entry_point(group, name)

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point

    return ep.load()

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load

    return self.resolve()

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve

    module = __import__(self.module_name, fromlist=['__name__'], level=0)

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/clipper-0.2.0-py2.7-macosx-10.7-x86_64.egg/clipper/src/peakfinder.py", line 17, in <module>

    from clipper.src.call_peak import call_peaks, poissonP

  File "/Users/nicholaswebster/anaconda2/lib/python2.7/site-packages/clipper-0.2.0-py2.7-macosx-10.7-x86_64.egg/clipper/src/call_peak.py", line 694, in <module>

    class MyGMM(mixture.GMM):

AttributeError: 'module' object has no attribute 'GMM'


Any thoughts?  Thanks

code4DNA

unread,
Jan 24, 2020, 4:03:00 PM1/24/20
to CLIPper-discuss
It may have something to do with the Scikit-learn version 0.20.4. Try installing version 0.18.2 before clipper (you may need to add --force-reinstall to the pip command)

pip install scikit-learn==0.18.2
Reply all
Reply to author
Forward
0 new messages