Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'that?': 0.05; 'paths': 0.07; 'python3': 0.07; 'sys': 0.07; 'mixed': 0.09; 'python': 0.11; 'jan': 0.12; '2.7': 0.14; 'isnt': 0.16; 'sys.path': 0.16; 'wrongly': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'module': 0.19; 'mechanism': 0.19; 'normally': 0.19; 'properly': 0.19; "python's": 0.19; "skip:' 30": 0.19; 'thu,': 0.19; 'seems': 0.21; '>>>': 0.22; 'import': 0.22; 'install': 0.23; 'package.': 0.24; 'recognize': 0.24; 'subject:problem': 0.24; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(on': 0.31; 'dawn': 0.31; 'idea,': 0.31; 'seemingly': 0.31; "skip:' 40": 0.31; 'subject:About': 0.31; 'subject:some': 0.31; 'run': 0.32; 'linux': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'installing': 0.36; 'being': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'more': 0.64; 'different': 0.65; 'dont': 0.67; 'system)': 0.69; 'apart': 0.72; 'batchelder': 0.84; 'installer': 0.84; 'malicious': 0.84; 'saying:': 0.84; '2013,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=YFKeP3YqnBY93rU3o9nonMWsVSyRoCrIE8ZGR3W8LMM=; b=pY9DKP3r2vvwcPu3CLq1M2+P4LpqRNHWCjc8VRai7/XVJ9JGRQlN/fY/oRGtHxzLjV MiyjpXZ1TI/kSyyq49hLfVUtJoY+auVxMwy4qVO5we0TwDao3KFlVcOMNIgIFJT3BYt5 c7juJe2fEnH+g/FJNGrnjgeb9x2hztoE0EP/ZWHmaYoYglF8jSb9xqZtJvDKisvN3jzG 97HdqGBGVxTTHHb6tOuPyHdZhmBLbcy9S+cAt4iVEfoRnRkDwTvmsnwKC2zbuOTnVwwe XWR+E+v5DTvacS144lomJUB7e89LHOa37TePhxVaYtTgcxUqgckLBoQ1I/T6n3Z8t+VV A89Q== X-Received: by 10.68.196.193 with SMTP id io1mr90167089pbc.46.1388684807214; Thu, 02 Jan 2014 09:46:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Rustom Mody Date: Thu, 2 Jan 2014 23:16:26 +0530 Subject: Re: About some problem To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388684810 news.xs4all.nl 2916 [2001:888:2000:d::a6]:50628 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62990 On Thu, Jan 2, 2014 at 11:06 PM, Ned Batchelder wrote: > On 1/2/14 12:05 PM, Rustom Mody wrote: > >> >> i'm not sure about this but isnt it normally the case that different >> version modules dont get mixed up like that? >> IOW if pytesser was a properly packaged 2.7 module would python 3 be >> able to get at it ?? >> > > If you use a Python 3 installer it can succeed at installing a Python 2 > package. Then you won't find out until you try to run the package that it is > incompatible. A mechanism to prevent this seems like a good idea, but since > it wasn't in place at the dawn of Python 3, it would be difficult to put in > place now. $ python3 Python 3.3.3 (default, Dec 8 2013, 16:34:29) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from sys import path >>> path ['', '/usr/lib/python3.3', '/usr/lib/python3.3/plat-i386-linux-gnu', '/usr/lib/python3.3/lib-dynload', '/usr/local/lib/python3.3/dist-packages', '/usr/lib/python3/dist-packages'] $ python Python 2.7.6 (default, Dec 6 2013, 21:56:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from sys import path >>> path ['', '/usr/local/lib/python2.7/dist-packages/pip-1.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode'] So as far as I can see (on a debian linux system) the paths are clearly 2.7-prefixed or 3.3-prefixed. So apart from being stupid and/or malicious to munge sys.path to tread on the other python's toes...??? Oh ok I get what you are saying: python3 will not recognize a python2 package and install it seemingly correctly but actually wrongly