Re: ImportError: No module named multiarray (is back)

2011-11-23 Thread Éric Araujo
Hi,

Le 22/11/2011 20:59, Zbigniew Jędrzejewski-Szmek a écrit :
> On 11/22/2011 04:38 PM, Mathieu Malaterre wrote:
>> [CC me please]
>> [...]
> This is a very unfortunate interaction between Python semantics (prepend 
> realpath of script to sys.path) and the Debian way of installing modules 
> (symlink farm between Python versions). Nevertheless, I think that 
> Python is wrong, and Debian is right. What Python does means that it is 
> not possible to run a Python script from /tmp or any other directory 
> writeable by other users securely. Even if this is by design, it is not 
> advertised well (or maybe even at all?) and is thus a big security hole.

Could you request a doc edition on bugs.python.org?  Thanks.  You’ll
likely get feedback from Nick Coghlan, one of the core developers most
knowledgeable about the import system.

> You can wait for Python 3.2 and the PEP 3149 (ABI version tagged .so 
> files) which makes the Debian-style symlinks farms unnecessary (just 
> joking :).

Are you really joking?  I thought that PEP 3147 and PEP 3149 were
especially designed to help Debian and Ubuntu get rid of their symlinks
farms.

Regards


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4ecd1d31.7080...@netwok.org



Re: ImportError: No module named multiarray (is back)

2011-11-23 Thread Mathieu Malaterre
[CC me please]

hi all,

2011/11/22 Zbigniew Jędrzejewski-Szmek :
[...]
> Hi Mathieu,
>
> I don't think that your problem can be solved in any simple way, apart from
> physically moving the script or providing a second helper script.
>
> This is a very unfortunate interaction between Python semantics (prepend
> realpath of script to sys.path) and the Debian way of installing modules
> (symlink farm between Python versions). Nevertheless, I think that Python is
> wrong, and Debian is right. What Python does means that it is not possible
> to run a Python script from /tmp or any other directory writeable by other
> users securely. Even if this is by design, it is not advertised well (or
> maybe even at all?) and is thus a big security hole.

Just like everything in computer, just add another extra layer of
indirection. However this is exaclty that layer of indirection that I
need help to get working.

[Copy pasted from http://lists.debian.org/debian-python/2011/11/msg00059.html]
Jakub Wilk :
> It'd tad easier for us to help you if you explained what you were trying to 
> do.

Short answer: trying to package the cellprofiler application. That is all.

I can get the application working from my $HOME or /tmp no problem.
However as soon as I move the CellProfiler.py within some know python
location things behave differently.

Package is at:
http://mentors.debian.net/package/cellprofiler

However it wont be very usefull as it wont work from the installed path.

Thanks
-- 
Mathieu


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CA+7wUsz5ioRp153BJv5DGKz_o=fPxXH+QV=zg9mvsgjecjy...@mail.gmail.com



Re: ImportError: No module named multiarray (is back)

2011-11-22 Thread Jakub Wilk

* Mathieu Malaterre , 2011-11-22, 16:38:

$ python /usr/lib/python2.7/dist-packages/CellProfiler.py
Traceback (most recent call last):
 File "/usr/lib/python2.7/dist-packages/CellProfiler.py", line 17, in 
   import numpy as np
 File "/usr/share/pyshared/numpy/__init__.py", line 136, in 
   import add_newdocs
 File "/usr/share/pyshared/numpy/add_newdocs.py", line 9, in 
   from numpy.lib import add_newdoc
 File "/usr/share/pyshared/numpy/lib/__init__.py", line 4, in 
   from type_check import *
 File "/usr/share/pyshared/numpy/lib/type_check.py", line 8, in 
   import numpy.core.numeric as _nx
 File "/usr/share/pyshared/numpy/core/__init__.py", line 5, in 
   import multiarray
ImportError: No module named multiarray


[...]

It'd tad easier for us to help you if you explained what you were trying 
to do.



But how do I load this file ?


What do you mean by "load"?

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2022200721.ga9...@jwilk.net



Re: ImportError: No module named multiarray (is back)

2011-11-22 Thread Zbigniew Jędrzejewski-Szmek

On 11/22/2011 04:38 PM, Mathieu Malaterre wrote:

[CC me please]

Hi all,

   The issue with multiarray came back. I manage to get things working
for the tifffile package installing the tifffile.py into
/usr/bin/tiffile (removing the py extension). However another package
is now failing: CellProfiler. Symptoms are:


$ python /usr/lib/python2.7/dist-packages/CellProfiler.py
Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/CellProfiler.py", line 17, in
 import numpy as np
   File "/usr/share/pyshared/numpy/__init__.py", line 136, in
 import add_newdocs
   File "/usr/share/pyshared/numpy/add_newdocs.py", line 9, in
 from numpy.lib import add_newdoc
   File "/usr/share/pyshared/numpy/lib/__init__.py", line 4, in
 from type_check import *
   File "/usr/share/pyshared/numpy/lib/type_check.py", line 8, in
 import numpy.core.numeric as _nx
   File "/usr/share/pyshared/numpy/core/__init__.py", line 5, in
 import multiarray
ImportError: No module named multiarray


Hi Mathieu,

I don't think that your problem can be solved in any simple way, apart 
from physically moving the script or providing a second helper script.


This is a very unfortunate interaction between Python semantics (prepend 
realpath of script to sys.path) and the Debian way of installing modules 
(symlink farm between Python versions). Nevertheless, I think that 
Python is wrong, and Debian is right. What Python does means that it is 
not possible to run a Python script from /tmp or any other directory 
writeable by other users securely. Even if this is by design, it is not 
advertised well (or maybe even at all?) and is thus a big security hole.



Now if I do:

$ cp /usr/lib/python2.7/dist-packages/CellProfiler.py /tmp
$ python /tmp/CellProfiler.py
Traceback (most recent call last):
   File "/tmp/CellProfiler.py", line 193, in
 os.chdir(os.path.join(root, script_path))
OSError: [Errno 2] No such file or directory: '/tmp/cellprofiler/cpmath'

Could someone please point me to some documentation get rid definitely
of this kind of issues.
You can wait for Python 3.2 and the PEP 3149 (ABI version tagged .so 
files) which makes the Debian-style symlinks farms unnecessary (just 
joking :).


Best,
Zbyszek

> I'd like to keep as much as the original

package as possible, therefore I would like to keep the
/usr/lib/python2.7/dist-packages/CellProfiler.py (or pyshared
equivalent). But how do I load this file ?

Thanks very much.



--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4ecbff19.8080...@in.waw.pl



ImportError: No module named multiarray (is back)

2011-11-22 Thread Mathieu Malaterre
[CC me please]

Hi all,

  The issue with multiarray came back. I manage to get things working
for the tifffile package installing the tifffile.py into
/usr/bin/tiffile (removing the py extension). However another package
is now failing: CellProfiler. Symptoms are:


$ python /usr/lib/python2.7/dist-packages/CellProfiler.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/CellProfiler.py", line 17, in 
import numpy as np
  File "/usr/share/pyshared/numpy/__init__.py", line 136, in 
import add_newdocs
  File "/usr/share/pyshared/numpy/add_newdocs.py", line 9, in 
from numpy.lib import add_newdoc
  File "/usr/share/pyshared/numpy/lib/__init__.py", line 4, in 
from type_check import *
  File "/usr/share/pyshared/numpy/lib/type_check.py", line 8, in 
import numpy.core.numeric as _nx
  File "/usr/share/pyshared/numpy/core/__init__.py", line 5, in 
import multiarray
ImportError: No module named multiarray


Now if I do:

$ cp /usr/lib/python2.7/dist-packages/CellProfiler.py /tmp
$ python /tmp/CellProfiler.py
Traceback (most recent call last):
  File "/tmp/CellProfiler.py", line 193, in 
os.chdir(os.path.join(root, script_path))
OSError: [Errno 2] No such file or directory: '/tmp/cellprofiler/cpmath'

Could someone please point me to some documentation get rid definitely
of this kind of issues. I'd like to keep as much as the original
package as possible, therefore I would like to keep the
/usr/lib/python2.7/dist-packages/CellProfiler.py (or pyshared
equivalent). But how do I load this file ?

Thanks very much.


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CA+7wUswQVDddJJiXaJFk8gNmYMW9L4W_3GtSWKDV9LAL=sa...@mail.gmail.com