Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20162

Re: changing sys.path

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <andrea.crotti.0@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.036
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'imports': 0.07; 'subject:changing': 0.07; 'extension.': 0.09; 'namespace': 0.09; 'declaration': 0.16; 'strangely': 0.16; 'cc:addr:python-list': 0.16; 'thanks,': 0.19; 'cc:no real name:2**0': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.26; 'example': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'message- id:@gmail.com': 0.31; 'changing': 0.32; 'header:User-Agent:1': 0.33; 'something': 0.35; 'received:209.85.214': 0.36; 'issue': 0.37; 'received:10.0.0': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'think': 0.38; 'suggestions': 0.39; 'received:209': 0.39; 'more': 0.61; 'care': 0.71; 'andrea': 0.84; 'directories,': 0.84; '(every': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8AwIgJ3yPQms4MhnVp06So5YG8q14gnqGXBVt3VoD1Y=; b=ZwjqEftXqueZRvk+a13q3RVKDLbn36U85/ZmiVBCCraLwGrPLYPNZd4Igb3Pa8E6vr tRmMdPnINZa5KJnFAuF6pGWisj3sikNZf9FPb6TlXbO0twNmWdPNd5FhnTkqvgjZmZBp OBMJ8nqwrkAyj5IJ79NZ0Uu9w4UJnsWwTM+jw=
Date Fri, 10 Feb 2012 13:08:28 +0000
From Andrea Crotti <andrea.crotti.0@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111224 Thunderbird/9.0.1
MIME-Version 1.0
To Rick Johnson <rantingrickjohnson@gmail.com>
Subject Re: changing sys.path
References <mailman.5303.1328112912.27778.python-list@python.org> <d0253e03-fed0-40db-8a7a-e9195ce92889@k28g2000yqc.googlegroups.com>
In-Reply-To <d0253e03-fed0-40db-8a7a-e9195ce92889@k28g2000yqc.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5658.1328879313.27778.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328879313 news.xs4all.nl 6917 [2001:888:2000:d::a6]:47686
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20162

Show key headers only | View raw


I think I finally located the issue with the sys.path extension.

The problem is that I have many namespace directories, for example

lib:
  - sub1
  - sub2

lib:
   - sub3
   - sub4

But to have everything working I had lib.sub3 in easy-install.pth.
Now if I try to add something else to the path it doesn't take care of 
the namespace
declaration
(every __init__.py in the packages contains: 
__import__('pkg_resources').declare_namespace(__name__))
and just doesn't find the other submodules..

If I try to add manually lib.sub1, lib.sub2 changing the sys.path the 
imports will only work for the first one.

Strangely if I just create a dev_main.pth in site-packages containing 
the same paths, everything works perfectly.

Any suggestions now that the problem is more clear?
Thanks,
Andrea

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-01 16:15 +0000
  Re: changing sys.path jmfauth <wxjmfauth@gmail.com> - 2012-02-01 09:06 -0800
  Re: changing sys.path Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-01 09:17 -0800
    Re: changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-10 13:08 +0000
    Re: changing sys.path Dave Angel <d@davea.name> - 2012-02-10 09:24 -0500
    Re: changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-10 14:51 +0000
    Re: changing sys.path Dave Angel <d@davea.name> - 2012-02-10 10:06 -0500
    Re: changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-10 15:14 +0000
    Re: changing sys.path Peter Otten <__peter__@web.de> - 2012-02-10 16:27 +0100
    Re: changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-10 15:38 +0000
    Re: changing sys.path Peter Otten <__peter__@web.de> - 2012-02-10 16:40 +0100
    Re: changing sys.path Peter Otten <__peter__@web.de> - 2012-02-10 17:00 +0100
    Re: changing sys.path Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-02-10 20:58 +0000
  Re: changing sys.path Tim Roberts <timr@probo.com> - 2012-02-02 21:10 -0800
  Re: changing sys.path John Nagle <nagle@animats.com> - 2012-02-08 13:43 -0800

csiph-web