Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. -------------------------------------------- ---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list. ---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this: from sklearn import datasets Traceback (most recent call last): File "bdt.py", line 12, in <module> from sklearn import datasets File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module> from .base import clone File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module> from .utils.fixes import signature File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong? Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
Hi Ruchika, could you maybe post the results from $ python -c 'import numpy; print(numpy.__version__)' 1.11.0 $ python -c 'import numpy; print(scipy.__version__)' 0.17.0 just to make sure that these are indeed the latest versions? However, I suspect that this is more of a compile rather than a version issue since scikit should work fine on older versions of NumPy and SciPy — e.g., one of the CI tests is running with NUMPY_VERSION=“1.6.2” and SCIPY_VERSION="0.11.0" Does NumPy run correctly if you run some examples without scikit-learn? E.g., you may want to run import numpy numpy.test('full') import scipy scipy.test('full’) to narrow down the problem further. And how did you compile & install scikit-learn? Best, Sebastian
On Jun 1, 2016, at 1:24 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com
This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list.
---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi
I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this:
from sklearn import datasets
Traceback (most recent call last): File "bdt.py", line 12, in <module> from sklearn import datasets File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module> from .base import clone File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module> from .utils.fixes import signature File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling
I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Hello Sebastian Thanks for some insight.. So here are some of my responses 1) $ python -c 'import numpy; print(numpy.__version__)' 1.8.0rc1 2) python -c 'import numpy; print(scipy.__version__)' Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'scipy' is not defined And I installed everything using pip install numpy/scikit-learn and so on. But when I tried to do this pip install --upgrade scipy Requirement already up-to-date: scipy in /Library/Python/2.7/site-packages Requirement already up-to-date: numpy>=1.6.2 in /Library/Python/2.7/site-packages (from scipy) So not sure why it is not being defined. Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. -------------------------------------------- On Wed, Jun 1, 2016 at 10:46 AM, Sebastian Raschka < mail@sebastianraschka.com> wrote:
Hi Ruchika,
could you maybe post the results from
$ python -c 'import numpy; print(numpy.__version__)' 1.11.0 $ python -c 'import numpy; print(scipy.__version__)' 0.17.0
just to make sure that these are indeed the latest versions? However, I suspect that this is more of a compile rather than a version issue since scikit should work fine on older versions of NumPy and SciPy — e.g., one of the CI tests is running with NUMPY_VERSION=“1.6.2” and SCIPY_VERSION="0.11.0"
Does NumPy run correctly if you run some examples without scikit-learn? E.g., you may want to run
import numpy numpy.test('full')
import scipy scipy.test('full’)
to narrow down the problem further.
And how did you compile & install scikit-learn?
Best, Sebastian
On Jun 1, 2016, at 1:24 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com
This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list.
---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi
I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this:
from sklearn import datasets
Traceback (most recent call last): File "bdt.py", line 12, in <module> from sklearn import datasets File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module> from .base import clone File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module> from .utils.fixes import signature File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling
I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Sorry, $ python -c 'import numpy; print(scipy.__version__)’ was a type, it should be $ python -c 'import scipy; print(scipy.__version__)’ However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging (https://github.com/scikit-learn/scikit-learn/issues/6706)! Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with" Best, Sebastian
On Jun 1, 2016, at 1:55 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Hello Sebastian
Thanks for some insight.. So here are some of my responses
1) $ python -c 'import numpy; print(numpy.__version__)' 1.8.0rc1
2) python -c 'import numpy; print(scipy.__version__)' Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'scipy' is not defined
And I installed everything using pip install numpy/scikit-learn and so on. But when I tried to do this pip install --upgrade scipy Requirement already up-to-date: scipy in /Library/Python/2.7/site-packages Requirement already up-to-date: numpy>=1.6.2 in /Library/Python/2.7/site-packages (from scipy)
So not sure why it is not being defined. Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
On Wed, Jun 1, 2016 at 10:46 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote: Hi Ruchika,
could you maybe post the results from
$ python -c 'import numpy; print(numpy.__version__)' 1.11.0 $ python -c 'import numpy; print(scipy.__version__)' 0.17.0
just to make sure that these are indeed the latest versions? However, I suspect that this is more of a compile rather than a version issue since scikit should work fine on older versions of NumPy and SciPy — e.g., one of the CI tests is running with NUMPY_VERSION=“1.6.2” and SCIPY_VERSION="0.11.0"
Does NumPy run correctly if you run some examples without scikit-learn? E.g., you may want to run
import numpy numpy.test('full')
import scipy scipy.test('full’)
to narrow down the problem further.
And how did you compile & install scikit-learn?
Best, Sebastian
On Jun 1, 2016, at 1:24 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com
This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list.
---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi
I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this:
from sklearn import datasets
Traceback (most recent call last): File "bdt.py", line 12, in <module> from sklearn import datasets File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module> from .base import clone File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module> from .utils.fixes import signature File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling
I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Hi, On Wed, Jun 1, 2016 at 11:00 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
Sorry,
$ python -c 'import numpy; print(scipy.__version__)’
was a type, it should be
$ python -c 'import scipy; print(scipy.__version__)’
However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging (https://github.com/scikit-learn/scikit-learn/issues/6706)!
Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with"
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python has its own numpy and scipy, that aren't in the usual places, and this leads to great confusion when you try and upgrade numpy / scipy / matplotilb. I recommend homebrew Python or Python.org Python instead: https://github.com/MacPython/wiki/wiki/Which-Python Cheers, Matthew
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac? Personally, I am using Conda’s dist., not the system Python python --version Python 3.5.1 :: Continuum Analytics, Inc.
On Jun 1, 2016, at 2:07 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
On Wed, Jun 1, 2016 at 11:00 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
Sorry,
$ python -c 'import numpy; print(scipy.__version__)’
was a type, it should be
$ python -c 'import scipy; print(scipy.__version__)’
However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging (https://github.com/scikit-learn/scikit-learn/issues/6706)!
Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with"
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python has its own numpy and scipy, that aren't in the usual places, and this leads to great confusion when you try and upgrade numpy / scipy / matplotilb. I recommend homebrew Python or Python.org Python instead:
https://github.com/MacPython/wiki/wiki/Which-Python
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
I also recommend Anaconda. I have installed on several variants of Linux as well as Mac and Windows, and it usually works right out of the box. Anytime it didn't, the issue was nothing that 5 minutes of Googling couldn't solve. I believe that scikit-learn is usually included, and if it isn't their package manager (conda) has almost always served me well. On Wed, Jun 1, 2016 at 2:17 PM, Sebastian Raschka <mail@sebastianraschka.com
wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac? Personally, I am using Conda’s dist., not the system Python
python --version Python 3.5.1 :: Continuum Analytics, Inc.
On Jun 1, 2016, at 2:07 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
On Wed, Jun 1, 2016 at 11:00 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
Sorry,
$ python -c 'import numpy; print(scipy.__version__)’
was a type, it should be
$ python -c 'import scipy; print(scipy.__version__)’
However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging ( https://github.com/scikit-learn/scikit-learn/issues/6706)!
Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with"
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python has its own numpy and scipy, that aren't in the usual places, and this leads to great confusion when you try and upgrade numpy / scipy / matplotilb. I recommend homebrew Python or Python.org Python instead:
https://github.com/MacPython/wiki/wiki/Which-Python
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- Stephen D. Shank, Ph. D. Department of Biology, Center for Computational Genetics and Genomics Temple University, Philadelphia, PA BioLife 106F sshank@temple.edu
I also strongly recommend the Anaconda distribution. Andrew <~~~~~~~~~~~~~~~~~~~~~~~~~~~> J. Andrew Howe, PhD Editor-in-Chief, European Journal of Mathematical Sciences Executive Editor, European Journal of Pure and Applied Mathematics www.andrewhowe.com http://www.linkedin.com/in/ahowe42 https://www.researchgate.net/profile/John_Howe12/ I live to learn, so I can learn to live. - me <~~~~~~~~~~~~~~~~~~~~~~~~~~~> On Wed, Jun 1, 2016 at 9:23 PM, STEPHEN D SHANK <sshank@temple.edu> wrote:
I also recommend Anaconda. I have installed on several variants of Linux as well as Mac and Windows, and it usually works right out of the box. Anytime it didn't, the issue was nothing that 5 minutes of Googling couldn't solve. I believe that scikit-learn is usually included, and if it isn't their package manager (conda) has almost always served me well.
On Wed, Jun 1, 2016 at 2:17 PM, Sebastian Raschka < mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac? Personally, I am using Conda’s dist., not the system Python
python --version Python 3.5.1 :: Continuum Analytics, Inc.
On Jun 1, 2016, at 2:07 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
On Wed, Jun 1, 2016 at 11:00 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
Sorry,
$ python -c 'import numpy; print(scipy.__version__)’
was a type, it should be
$ python -c 'import scipy; print(scipy.__version__)’
However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging ( https://github.com/scikit-learn/scikit-learn/issues/6706)!
Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with"
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python has its own numpy and scipy, that aren't in the usual places, and this leads to great confusion when you try and upgrade numpy / scipy / matplotilb. I recommend homebrew Python or Python.org Python instead:
https://github.com/MacPython/wiki/wiki/Which-Python
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
--
Stephen D. Shank, Ph. D. Department of Biology, Center for Computational Genetics and Genomics Temple University, Philadelphia, PA BioLife 106F sshank@temple.edu
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places: $ /usr/bin/python -c 'import numpy; print(numpy.__file__)' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored. In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself. Cheers, Matthew
Hi guys, I recommend using https://virtualenv.pypa.io <https://virtualenv.pypa.io/en/stable/> to solve those issues! Best regards, Andrea On Wednesday, 1 June 2016, Matthew Brett <matthew.brett@gmail.com> wrote:
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com <javascript:;>> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)'
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org <javascript:;> https://mail.python.org/mailman/listinfo/scikit-learn
Just to note, anaconda also has it's own method of managing environments: On Wed, Jun 1, 2016 at 2:43 PM, Andrea Bravi <andrea.bravi@gmail.com> wrote:
Hi guys,
I recommend using https://virtualenv.pypa.io <https://virtualenv.pypa.io/en/stable/> to solve those issues!
Best regards,
Andrea
On Wednesday, 1 June 2016, Matthew Brett <matthew.brett@gmail.com> wrote:
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)'
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
-- Stephen D. Shank, Ph. D. Department of Biology, Center for Computational Genetics and Genomics Temple University, Philadelphia, PA BioLife 106F sshank@temple.edu
Much thanks for your advice I was able to sort out the issue with ValueError due to num/scipy I just removed the default one that came with python 2.7 and re-installed latest version. I did the same for matplotlib but if I do this import matplotlib.pyplot as plt It gives me this error: Learning BDTs with TMVA and Scikit /Library/Python/2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') Traceback (most recent call last): File "bdt.py", line 12, in <module> import matplotlib.pyplot as plt File "/Library/Python/2.7/site-packages/matplotlib/pyplot.py", line 36, in <module> from matplotlib.figure import Figure, figaspect File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 40, in <module> from matplotlib.axes import Axes, SubplotBase, subplot_class_factory File "/Library/Python/2.7/site-packages/matplotlib/axes/__init__.py", line 4, in <module> from ._subplots import * File "/Library/Python/2.7/site-packages/matplotlib/axes/_subplots.py", line 10, in <module> from matplotlib.axes._axes import Axes File "/Library/Python/2.7/site-packages/matplotlib/axes/_axes.py", line 22, in <module> import matplotlib.dates as _ # <-registers a date unit converter File "/Library/Python/2.7/site-packages/matplotlib/dates.py", line 126, in <module> from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, File "/Library/Python/2.7/site-packages/dateutil/rrule.py", line 19, in <module> from six.moves import _thread ImportError: cannot import name _thread Do you have any idea as to what this could be? Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. -------------------------------------------- On Wed, Jun 1, 2016 at 11:45 AM, STEPHEN D SHANK <sshank@temple.edu> wrote:
Just to note, anaconda also has it's own method of managing environments:
On Wed, Jun 1, 2016 at 2:43 PM, Andrea Bravi <andrea.bravi@gmail.com> wrote:
Hi guys,
I recommend using https://virtualenv.pypa.io <https://virtualenv.pypa.io/en/stable/> to solve those issues!
Best regards,
Andrea
On Wednesday, 1 June 2016, Matthew Brett <matthew.brett@gmail.com> wrote:
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)'
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
--
Stephen D. Shank, Ph. D. Department of Biology, Center for Computational Genetics and Genomics Temple University, Philadelphia, PA BioLife 106F sshank@temple.edu
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
I just removed the default one that came with python 2.7
As a general advice, I would never ever mess with the system Python; you could easily break something … “important” :P Why not creating a separate virtual environment to be on the safe side?
On Jun 1, 2016, at 2:51 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Much thanks for your advice I was able to sort out the issue with ValueError due to num/scipy I just removed the default one that came with python 2.7 and re-installed latest version. I did the same for matplotlib but if I do this import matplotlib.pyplot as plt
It gives me this error: Learning BDTs with TMVA and Scikit /Library/Python/2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') Traceback (most recent call last): File "bdt.py", line 12, in <module> import matplotlib.pyplot as plt File "/Library/Python/2.7/site-packages/matplotlib/pyplot.py", line 36, in <module> from matplotlib.figure import Figure, figaspect File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 40, in <module> from matplotlib.axes import Axes, SubplotBase, subplot_class_factory File "/Library/Python/2.7/site-packages/matplotlib/axes/__init__.py", line 4, in <module> from ._subplots import * File "/Library/Python/2.7/site-packages/matplotlib/axes/_subplots.py", line 10, in <module> from matplotlib.axes._axes import Axes File "/Library/Python/2.7/site-packages/matplotlib/axes/_axes.py", line 22, in <module> import matplotlib.dates as _ # <-registers a date unit converter File "/Library/Python/2.7/site-packages/matplotlib/dates.py", line 126, in <module> from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, File "/Library/Python/2.7/site-packages/dateutil/rrule.py", line 19, in <module> from six.moves import _thread ImportError: cannot import name _thread
Do you have any idea as to what this could be?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
On Wed, Jun 1, 2016 at 11:45 AM, STEPHEN D SHANK <sshank@temple.edu> wrote: Just to note, anaconda also has it's own method of managing environments:
On Wed, Jun 1, 2016 at 2:43 PM, Andrea Bravi <andrea.bravi@gmail.com> wrote:
Hi guys,
I recommend using https://virtualenv.pypa.io to solve those issues!
Best regards,
Andrea
On Wednesday, 1 June 2016, Matthew Brett <matthew.brett@gmail.com> wrote: On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
--
Stephen D. Shank, Ph. D. Department of Biology, Center for Computational Genetics and Genomics Temple University, Philadelphia, PA BioLife 106F sshank@temple.edu
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Oh that’s interesting, thanks for the info! I have never used the system Python and didn’t know that it comes with its own NumPy & SciPy; I thought it was more bare bones (sorry about the naive question, but is this a recent thing in Yosemite or has it been always like this?)
On Jun 1, 2016, at 2:39 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
I am more naive than you ;) I have no clue! Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. -------------------------------------------- On Wed, Jun 1, 2016 at 11:50 AM, Sebastian Raschka < mail@sebastianraschka.com> wrote:
Oh that’s interesting, thanks for the info! I have never used the system Python and didn’t know that it comes with its own NumPy & SciPy; I thought it was more bare bones (sorry about the naive question, but is this a recent thing in Yosemite or has it been always like this?)
On Jun 1, 2016, at 2:39 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
On Wed, Jun 1, 2016 at 11:17 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
I think you're using system Python on the Mac. I'd really strongly recommend against that, because system Python
Yeah, but I think that the system Python doesn’t come with NumPy and SciPy installed on a Mac?
That's the entire problem - system Python has its own private copy of numpy and scipy and matplotlib that are not in the usual sys.path places:
$ /usr/bin/python -c 'import numpy; print(numpy.__file__)'
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc
Then, if you try to upgrade them with pip, the new packages are below the private copies in directory precedence, and the effect is that the upgrade is ignored.
In effect, system Python is for the system, if you want to own your Python, you need to install another copy for yourself.
Cheers,
Matthew _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
On Wed, Jun 1, 2016 at 11:50 AM, Sebastian Raschka <mail@sebastianraschka.com> wrote:
Oh that’s interesting, thanks for the info! I have never used the system Python and didn’t know that it comes with its own NumPy & SciPy; I thought it was more bare bones (sorry about the naive question, but is this a recent thing in Yosemite or has it been always like this?)
It's been like this since at least OSX 10.6, I haven't got anything earlier to test on. Yes, virtualenv is also a good solution, but I'd still prefer homebrew / python.org, because it allows you to install system packages without worrying about breaking things or running into path oddness, as here. Cheers, Matthew
I also copy pasted blindly. Actually I see that both numpy and scipy have older versions and not the new ones that I want. Let me look into the thread and do more debugging. Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. -------------------------------------------- On Wed, Jun 1, 2016 at 11:00 AM, Sebastian Raschka < mail@sebastianraschka.com> wrote:
Sorry,
$ python -c 'import numpy; print(scipy.__version__)’
was a type, it should be
$ python -c 'import scipy; print(scipy.__version__)’
However, I’d recommend looking at the Issue 6706 as Nelson Liu suggested for further debugging ( https://github.com/scikit-learn/scikit-learn/issues/6706)!
Like Maniteja suggested, it is likely due to “a mismatch between numpy installed and the one scikit-learn is compiled with"
Best, Sebastian
On Jun 1, 2016, at 1:55 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Hello Sebastian
Thanks for some insight.. So here are some of my responses
1) $ python -c 'import numpy; print(numpy.__version__)' 1.8.0rc1
2) python -c 'import numpy; print(scipy.__version__)' Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'scipy' is not defined
And I installed everything using pip install numpy/scikit-learn and so on. But when I tried to do this pip install --upgrade scipy Requirement already up-to-date: scipy in /Library/Python/2.7/site-packages Requirement already up-to-date: numpy>=1.6.2 in /Library/Python/2.7/site-packages (from scipy)
So not sure why it is not being defined. Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
On Wed, Jun 1, 2016 at 10:46 AM, Sebastian Raschka < mail@sebastianraschka.com> wrote: Hi Ruchika,
could you maybe post the results from
$ python -c 'import numpy; print(numpy.__version__)' 1.11.0 $ python -c 'import numpy; print(scipy.__version__)' 0.17.0
just to make sure that these are indeed the latest versions? However, I suspect that this is more of a compile rather than a version issue since scikit should work fine on older versions of NumPy and SciPy — e.g., one of the CI tests is running with NUMPY_VERSION=“1.6.2” and SCIPY_VERSION="0.11.0"
Does NumPy run correctly if you run some examples without scikit-learn? E.g., you may want to run
import numpy numpy.test('full')
import scipy scipy.test('full’)
to narrow down the problem further.
And how did you compile & install scikit-learn?
Best, Sebastian
On Jun 1, 2016, at 1:24 PM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com
This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list.
---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi
I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this:
from sklearn import datasets
Traceback (most recent call last): File "bdt.py", line 12, in <module> from sklearn import datasets File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module> from .base import clone File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module> from .utils.fixes import signature File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling
I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
On Wed, Jun 1, 2016 at 11:08 AM, Ruchika Nayyar <ruchika.work@gmail.com> wrote:
I also copy pasted blindly. Actually I see that both numpy and scipy have older versions and not the new ones that I want. Let me look into the thread and do more debugging.
Yes, this is very likely because of the problem I pointed to with system Python. Cheers, Matthew
Hi Ruchika, See if any of the suggestions in this issue ( https://github.com/scikit-learn/scikit-learn/issues/6706) help, it seems to be the same issue. Try reinstalling scikit-learn as well. Nelson Liu On Wed, Jun 1, 2016 at 10:33 AM Ruchika Nayyar <ruchika.work@gmail.com> wrote:
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
---------- Forwarded message ---------- From: <scikit-learn-owner@python.org> Date: Wed, Jun 1, 2016 at 10:23 AM Subject: ValueError To: ruchika.work@gmail.com
This list allows posts by subscribers only. Please subscribe at https://mail.python.org/mailman/listinfo/scikit-learn to post to the list.
---------- Forwarded message ---------- From: Ruchika Nayyar <ruchika.work@gmail.com> To: scikit-learn@python.org Cc: Date: Wed, 1 Jun 2016 10:23:14 -0700 Subject: ValueError Hi
I am new to scikit-learn and while writing a python script to do a simple BDT using scikit-learn. I see error when I do this:
from sklearn import datasets
Traceback (most recent call last):
File "bdt.py", line 12, in <module>
from sklearn import datasets
File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module>
from .utils.fixes import signature
File "/Library/Python/2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module>
from .murmurhash import murmurhash3_32
File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
I have already tried to uninstall numpy/scipy and pandas. They all are the latest and compatible version but something is not right. Can you tell me what I am doing wrong?
Thanks, Ruchika ---------------------------------------- Dr Ruchika Nayyar, Post Doctoral Fellow for ATLAS Collaboration University of Arizona Arizona, USA. --------------------------------------------
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Hi , I hope I am understanding the question correctly here. This happens when there is mismatch between numpy installed and the one scikit-learn is compiled with. In case there are multiple versions of numpy installed, it is preferable to put the newest one on PYTHONPATH. If a stable version is needed, uninstall previously installed scikit-learn, use ``pip install --upgrade numpy`` and then reinstall scikit-learn. Hope it is helpful. Regards, Maniteja. _________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
The best solution is to use either Canopy or Anaconda and avoid installing the PyData ecosystem manually. These distributions neatly avoid compile and version problems. __________________________________________________________________________________________ Dale Smith | Macy's Systems and Technology | IFS eCommerce | Data Science and Capacity Planning | 5985 State Bridge Road, Johns Creek, GA 30097 | dale.t.smith@macys.com From: scikit-learn [mailto:scikit-learn-bounces+dale.t.smith=macys.com@python.org] On Behalf Of Maniteja Nandana Sent: Wednesday, June 1, 2016 1:53 PM To: Scikit-learn user and developer mailing list Subject: Re: [scikit-learn] Fwd: ValueError ⚠ EXT MSG: Hi , I hope I am understanding the question correctly here. This happens when there is mismatch between numpy installed and the one scikit-learn is compiled with. In case there are multiple versions of numpy installed, it is preferable to put the newest one on PYTHONPATH. If a stable version is needed, uninstall previously installed scikit-learn, use ``pip install --upgrade numpy`` and then reinstall scikit-learn. Hope it is helpful. Regards, Maniteja. _________________________________________ scikit-learn mailing list scikit-learn@python.org<mailto:scikit-learn@python.org> https://mail.python.org/mailman/listinfo/scikit-learn * This is an EXTERNAL EMAIL. Stop and think before clicking a link or opening attachments.
Hi, As Nelson suggested, probably the version pip shows and imported in python are not matching. Could you see the output of ``pip freeze`` ? In case that is not 1.8.0rc then the solution in that issue would probably be helpful here. Regards, Maniteja.
participants (9)
-
Andrea Bravi -
Andrew Howe -
Dale T Smith -
Maniteja Nandana -
Matthew Brett -
Nelson Liu -
Ruchika Nayyar -
Sebastian Raschka -
STEPHEN D SHANK