Hello all, I am having problems with numpy (version 1.5.1) when executing this command as root, evry thing is OK: python -Wd -c 'import numpy; numpy.test()' Running unit tests for numpy NumPy version 1.5.1 NumPy is installed in /usr/local/lib64/python2.6/site-packages/numpy Python version 2.6 (r26:66714, Nov 9 2010, 01:31:57) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] nose version 1.0.0 ...................... Ran 3006 tests in 14.088s OK (KNOWNFAIL=4) But as a normal user (non root), the same command show errors: python -Wd -c 'import numpy; numpy.test()' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py", line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there. Python 2.6 Linux <machine> 2.6.32.27-0.2-default x86_64 x86_64 x86_64 GNU/Linux modules are in /usr/local/lib64/python2.6/site-packages/ Any help will be appreciated. -- Cordialement Mustapha Bouikhif CNRS - IDRIS Tel: +33 1 69 35 85 27 Fax: +33 1 69 35 37 75 E-mail: mustapha.bouikhif@idris.fr http://www.idris.fr
On Thu, Feb 24, 2011 at 10:04 AM, Mustapha BOUIKHIF < mustapha.bouikhif@idris.fr> wrote:
Hello all,
I am having problems with numpy (version 1.5.1)
when executing this command as root, evry thing is OK: python -Wd -c 'import numpy; numpy.test()'
Running unit tests for numpy NumPy version 1.5.1 NumPy is installed in /usr/local/lib64/python2.6/site-packages/numpy Python version 2.6 (r26:66714, Nov 9 2010, 01:31:57) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] nose version 1.0.0
...................... Ran 3006 tests in 14.088s
OK (KNOWNFAIL=4)
But as a normal user (non root), the same command show errors:
python -Wd -c 'import numpy; numpy.test()' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py", line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there.
Python 2.6 Linux <machine> 2.6.32.27-0.2-default x86_64 x86_64 x86_64 GNU/Linux modules are in /usr/local/lib64/python2.6/site-packages/
Any help will be appreciated.
Mustapha, "ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there." It is generally a bad idea to import installed modules directly from their source directory. Just change your working directory to another location where "numpy" is not a directory, and you should be able to run the tests. Ben Root
import os os.getcwd() *'/home/idris/cos/scos190'* import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py",
Benjamin, I am not in numpy install dir and have the error however: #python Python 2.6 (r26:66714, Nov 9 2010, 01:31:57) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2 Type "help", "copyright", "credits" or "license" for more information. line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there. Benjamin Root wrote:
On Thu, Feb 24, 2011 at 10:04 AM, Mustapha BOUIKHIF
mailto:mustapha.bouikhif@idris.fr> wrote: Hello all,
I am having problems with numpy (version 1.5.1)
when executing this command as root, evry thing is OK: python -Wd -c 'import numpy; numpy.test()'
Running unit tests for numpy NumPy version 1.5.1 NumPy is installed in /usr/local/lib64/python2.6/site-packages/numpy Python version 2.6 (r26:66714, Nov 9 2010, 01:31:57) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] nose version 1.0.0
...................... Ran 3006 tests in 14.088s
OK (KNOWNFAIL=4)
But as a normal user (non root), the same command show errors:
python -Wd -c 'import numpy; numpy.test()' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py", line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there.
Python 2.6 Linux <machine> 2.6.32.27-0.2-default x86_64 x86_64 x86_64 GNU/Linux modules are in /usr/local/lib64/python2.6/site-packages/
Any help will be appreciated.
Mustapha,
"ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there."
It is generally a bad idea to import installed modules directly from their source directory. Just change your working directory to another location where "numpy" is not a directory, and you should be able to run the tests.
Ben Root
------------------------------------------------------------------------
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Cordialement Mustapha Bouikhif CNRS - IDRIS Tel: +33 1 69 35 85 27 Fax: +33 1 69 35 37 75 E-mail: mustapha.bouikhif@idris.fr http://www.idris.fr
On Thu, Feb 24, 2011 at 10:35 AM, Mustapha BOUIKHIF < mustapha.bouikhif@idris.fr> wrote:
Benjamin,
I am not in numpy install dir and have the error however:
import os os.getcwd() *'/home/idris/cos/scos190'* import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py",
#python Python 2.6 (r26:66714, Nov 9 2010, 01:31:57) [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2 Type "help", "copyright", "credits" or "license" for more information. line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there.
Are there any directories called "numpy" in /home/idris/cos/scos190? Could you try cd-ing over to another directory and trying again? Ben Root
Thu, 24 Feb 2011 10:40:17 -0600, Benjamin Root wrote: [clip]
import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib64/python2.6/site-packages/numpy/__init__.py", line 127, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there. [clip] Are there any directories called "numpy" in /home/idris/cos/scos190? Could you try cd-ing over to another directory and trying again?
Another possible reason is that Numpy was installed wrong (as the numpy.__config__ module is apparently missing). Numpy needs to be installed via "python setup.py install", manually copying the "numpy" directory is not enough. -- Pauli Virtanen
Thu, 24 Feb 2011 16:47:14 +0000, Pauli Virtanen wrote:
Another possible reason is that Numpy was installed wrong (as the numpy.__config__ module is apparently missing). Numpy needs to be installed via "python setup.py install", manually copying the "numpy" directory is not enough.
Or, the permissions of "/usr/local/lib64/python2.6/site-packages/numpy/ __config__.py" (and possibly other files) are such that only root can read them. -- Pauli Virtanen
Pauli Virtanen wrote:
Thu, 24 Feb 2011 16:47:14 +0000, Pauli Virtanen wrote:
Another possible reason is that Numpy was installed wrong (as the numpy.__config__ module is apparently missing). Numpy needs to be installed via "python setup.py install", manually copying the "numpy" directory is not enough.
Or, the permissions of "/usr/local/lib64/python2.6/site-packages/numpy/ __config__.py" (and possibly other files) are such that only root can read them.
Numpy was installed correctly. It was a permission problem: many files were not readable by non-root users. It works fine now. Thanks. -- Cordialement Mustapha Bouikhif CNRS - IDRIS Tel: +33 1 69 35 85 27 Fax: +33 1 69 35 37 75 E-mail: mustapha.bouikhif@idris.fr http://www.idris.fr
participants (3)
-
Benjamin Root
-
Mustapha BOUIKHIF
-
Pauli Virtanen