From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Re: PYTHONPATH woes Date: Tue, 20 Feb 2018 16:01:35 +0100 Message-ID: <20180220150135.GA20101@thebird.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eo9U3-0000Zo-1v for guix-devel@gnu.org; Tue, 20 Feb 2018 10:05:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eo9Tx-0007Wv-4d for guix-devel@gnu.org; Tue, 20 Feb 2018 10:05:31 -0500 Received: from mail.thebird.nl ([95.154.246.10]:58292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eo9Tw-0007WJ-Ox for guix-devel@gnu.org; Tue, 20 Feb 2018 10:05:24 -0500 Content-Disposition: inline In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org On Tue, Feb 20, 2018 at 11:53:54AM +0100, Ricardo Wurmus wrote: > Would it be good to make the wrappers for Python scripts stricter and > not accept any user-set PYTHONPATH? I think that is a bad idea. You need to be able to opt out. Also people need to experiment with modules without understanding Guix per se. In my upcomping blog I would emphasize packaging at the point you become a serious user. That should come with a health warning ;). Similarly we should allow for LD_LIBRARY_PATH etc. It is what they exist for, even if it is dangerous. > How do we approach the problem of having both Python 2 modules and > Python 3 modules in the same profile? PYTHONPATH will be set to refer > to the site-packages directories of both versions, which is never good. > Does Python offer us a way to do better? Can we make use of pth files > to get around this problem somehow? Python should have created PYTHONPATH2 to split them out. We could patch python2 to do just that. Even so, the real solution is separate profiles. I get that with versions of Ruby too. Pj.