[Numpy-discussion] [SciPy-Dev] Setting up a dev environment with conda
Michael Sarahan
msarahan at gmail.com
Sun Oct 18 20:02:34 EDT 2015
Running tests in the folder might be causing your problem. If it's trying
to import numpy, and numpy is a folder in your current folder, sometimes
you see errors like this. The confusion is that Python treats folders
(packages) similarly to modules, and the resolution order sometimes bites
you. Try cd'ing to a different folder (importantly, one NOT containing a
numpy folder!) and run the test command from there.
HTH,
Michael
On Sun, Oct 18, 2015 at 6:46 PM Luke Zoltan Kelley <lzkelley at gmail.com>
wrote:
> Thanks Yu,
>
> There was nothing in my PYTHONPATH at first, and adding my numpy directory
> ('/Users/lzkelley/Programs/public/numpy') didn't help (same error). In
> both cases, adding 'print(np)' yields:
>
> <module 'numpy' from
> '/Users/lzkelley/Programs/public/numpy/numpy/__init__.pyc'>
>
>
> > On Oct 18, 2015, at 7:22 PM, Feng Yu <rainwoodman at gmail.com> wrote:
> >
> > Hi Luke,
> >
> > Could you check if you have "/Users/lzkelley/Programs/public/numpy/ in
> > your PYTHONPATH?
> >
> > I would also suggest you add a print(np) line before the crash in
> > nosetester.py. I got something like this (which didn't crash):
> >
> > <module 'numpy' from
> >
> '/home/yfeng1/source/numpy/build/testenv/lib64/python2.7/site-packages/numpy/__init__.pyc'>
> >
> > If you see something not starting with 'numpy/build', then it is again
> > pointing at PYTHONPATH.
> >
> > I hope these helps.
> >
> > Best,
> >
> > - Yu
> >
> > On Sun, Oct 18, 2015 at 1:25 PM, Luke Zoltan Kelley <lzkelley at gmail.com>
> wrote:
> >> Thanks for the help Nathaniel --- but building via `./runtests.py` is
> >> failing in the same way. Hopefully Numpy-discussion can help me out.
> >>
> >> I'm able to build using `python setup.py build_ext --inplace` but both
> >> trying to run `python setup.py install` or `./runtests.py` leads to the
> >> following error:
> >>
> >> (numpy-py27)daedalus-2:numpy lzkelley$ ./runtests.py
> >> Building, see build.log...
> >> Running from numpy source directory.
> >> Traceback (most recent call last):
> >> File "setup.py", line 264, in <module>
> >> setup_package()
> >> File "setup.py", line 248, in setup_package
> >> from numpy.distutils.core import setup
> >> File
> "/Users/lzkelley/Programs/public/numpy/numpy/distutils/__init__.py",
> >> line 21, in <module>
> >> from numpy.testing import Tester
> >> File "/Users/lzkelley/Programs/public/numpy/numpy/testing/__init__.py",
> >> line 14, in <module>
> >> from .utils import *
> >> File "/Users/lzkelley/Programs/public/numpy/numpy/testing/utils.py",
> line
> >> 17, in <module>
> >> from numpy.core import float32, empty, arange, array_repr, ndarray
> >> File "/Users/lzkelley/Programs/public/numpy/numpy/core/__init__.py",
> line
> >> 59, in <module>
> >> test = Tester().test
> >> File
> "/Users/lzkelley/Programs/public/numpy/numpy/testing/nosetester.py",
> >> line 180, in __init__
> >> if raise_warnings is None and '.dev0' in np.__version__:
> >> AttributeError: 'module' object has no attribute '__version__'
> >>
> >> Build failed!
> >>
> >>
> >> Has anyone seen something like this before?
> >>
> >> Thanks!
> >> Luke
> >>
> >> _______________________________________________
> >> NumPy-Discussion mailing list
> >> NumPy-Discussion at scipy.org
> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >>
> > _______________________________________________
> > NumPy-Discussion mailing list
> > NumPy-Discussion at scipy.org
> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151019/561e633d/attachment.html>
More information about the NumPy-Discussion
mailing list