Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Seed me, Seymour" -- a random number generator meets the big green mother from outer space


devel / comp.lang.python / PythonPath / sys.path

SubjectAuthor
* PythonPath / sys.pathGrizzy Adams
`- Re: PythonPath / sys.pathStefan Ram

1
PythonPath / sys.path

<mailman.61.1684078191.13552.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23223&group=comp.lang.python#23223

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: RealGriz...@vivaldi.net (Grizzy Adams)
Newsgroups: comp.lang.python
Subject: PythonPath / sys.path
Date: Sat, 13 May 2023 11:42:52 +0100
Lines: 58
Message-ID: <mailman.61.1684078191.13552.python-list@python.org>
References: <645F69AC.14631.33F7F4@RealGrizzlyAdams.vivaldi.net>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
X-Trace: news.uni-berlin.de v4Xx2wzDL/yxJr8/2KiRvwazrRnyoCOSEB0jhuxG4dqQ==
Return-Path: <RealGrizzlyAdams@vivaldi.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=vivaldi.net header.i=@vivaldi.net header.b=AS+fa9uN;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'traceback': 0.04; '(most':
0.05; 'last):': 0.05; '(to': 0.07; 'importerror:': 0.07;
'modules': 0.07; 'restart': 0.09; 'skip:[ 60': 0.09; 'help,':
0.14; 'import': 0.15; 'pointers': 0.16; 'variable,': 0.16;
'problem': 0.16; "can't": 0.17; 'to:addr:python-list': 0.20;
'run': 0.23; 'tried': 0.26; '>>>': 0.28; 'wrong': 0.28; 'error':
0.29; 'seem': 0.31; 'effect': 0.31; 'module': 0.31; '"",': 0.32;
"skip:' 40": 0.32; 'skip:= 30': 0.32; 'window': 0.32; 'but': 0.32;
"i'm": 0.33; 'path': 0.33; 'windows': 0.34; 'work,': 0.36; "skip:'
10": 0.37; 'really': 0.37; 'using': 0.37; 'file': 0.38; 'two':
0.39; 'adding': 0.39; 'learn': 0.40; 'want': 0.40; 'try': 0.40;
'search': 0.61; 'named': 0.65; 'net': 0.69; 'times': 0.69;
'(other': 0.84; 'fresh': 0.91
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net 2F08EBD4DA
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net;
s=default; t=1683974576;
bh=am0gL7Jv/2pHj5yqcPhW6r8b66a6NoGO9BHbHfPrec4=;
h=From:To:Date:Subject:From;
b=AS+fa9uN7qSiGS/J8KhfrYeuJbZJM8wNbKjmypDS50D3+fwCqxvLmro+9JMk4PKwS
8mIqV/Z+AtP2zbiqiNkUqENRMHy1DYwcGq+b72CkzTV2SNakmJ4thEw9QH+He1Q/aW
i/RQUPpUQkUvbxnGun7il/uwt8P0r5zWqBh6QT6zi7WwRoaqmrTltQC7TBrzum8vNQ
9Nu0Nvbgluqz6getMmahke+IFIB2l333gBypiRnwFkhoAGG6zNN6iIi7fQXjMGNKyU
PqidHox/nVfzwuHwmTKsaCMmES6H3MeoPlV1ZY8cb71fKzGr8rxzhBUNebFBMLQ87X
p/RlHA/+6ajfQ==
X-Virus-Scanned: Debian amavisd-new at smtp.vivaldi.net
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net AD765BD015
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net;
s=default; t=1683974573;
bh=am0gL7Jv/2pHj5yqcPhW6r8b66a6NoGO9BHbHfPrec4=;
h=From:To:Date:Subject:From;
b=hrCc5MLx7lH6vvoq6FCf9zcDCfEjn+Ie9FeJk5C7exAqbJS2LV1OsdQOdFLI4q0Hc
GAlLkQOH3CAA9CvUccurGdSRP5ePCYCvCJVrI7etb2CxuydXAImTGeoBlv8AP1QtJR
6kNpMO/f1hOK/6lVw4q4XJscmXNG4UaE8PwGCKrs+ww7VNINQP/4t2Q8nkzAmiS60t
J6s9zIr4pQKjgPtM6hutrmEediCWK7o7VQFsYaEqm3FlfFnNUaExZnCrau0wuAmRcy
gdypx11kJ4WB6JAGrucocfHn6MYsdiVxQ9kpZ3jHaGH20ir+eynnSThbP6UtWhbfU9
nqf+0umWMgv2A==
Priority: normal
Content-description: Mail message body
X-Mailman-Approved-At: Sun, 14 May 2023 11:29:50 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://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: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <645F69AC.14631.33F7F4@RealGrizzlyAdams.vivaldi.net>
 by: Grizzy Adams - Sat, 13 May 2023 10:42 UTC

Hi All

My first post (repeated)

I am having a problem with PythonPath / sys.path

I have a dir where I keep all my current work, but I can't seem to add it to
PythonPath / sys.path

When I try to import one of my modules I see

>>>import My_Working_File
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import My_Working_File
ImportError: No module named 'My_Working_File'

I have tried adding my dir in registry to the existing PythonPath

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.4\PythonPath]
@="D:\\Shades\\Tools\\Python\\Lib;D:\\Shades\\Tools\\Python\\DLLs"

that did not help,

I tried adding PYTHONPATH as an enviramental variable, that also had no effect

(I did re-boot after these two tests)

If I go to the editor window and run (F5) any of my modules then I can

>>> ================================ RESTART ================================
>>>
>>> import My_Working_File
>>>

without error

I can also (from a fresh start)

>>> import sys
>>> sys.path.append(r'D:\Shades\Tools\Python\MyWork')
>>> print(sys.path)
['', 'D:\\Shades\\Tools\\Python\\Lib\\idlelib',
'D:\\Shades\\Tools\\Python\\python34.zip', 'D:\\Shades\\Tools\\Python\\DLLs',
'D:\\Shades\\Tools\\Python\\lib', 'D:\\Shades\\Tools\\Python',
'D:\\Shades\\Tools\\Python\\lib\\site-packages',
'D:\\Shades\\Tools\\Python\\MyWork']
>>> import My_Working_File
>>>

I don't really want to go this route every time I start work, and more to the
point I will need (to learn how) to add dir's to the path at times

I did search the net for an answer but only got what I had already tried

any pointers what I'm doing wrong (other than using windows '->)

Grizz

Re: PythonPath / sys.path

<path-20230514173338@ram.dialup.fu-berlin.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23224&group=comp.lang.python#23224

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: PythonPath / sys.path
Date: 14 May 2023 16:42:05 GMT
Organization: Stefan Ram
Lines: 19
Expires: 1 May 2024 11:59:58 GMT
Message-ID: <path-20230514173338@ram.dialup.fu-berlin.de>
References: <mailman.61.1684078191.13552.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de I5a2MAxudMso1DFiwmlQmwLUlrfQLUPK5CF28fLZokKSov
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Sun, 14 May 2023 16:42 UTC

"Grizzy Adams" <RealGrizzlyAdams@vivaldi.net> writes:
>I don't really want to go this route every time I start work, and more to the
>point I will need (to learn how) to add dir's to the path at times

Sometimes, an editable install of the path with your module helps.

pip install -e <absolute path of the dir containing your module(s)>

Above, "<absolute path of the dir containing your module(s)>"
should be replaced with the absolute path of the directory
containing your module(s).

Now, Python should be able to permanently find your modules!

Replace "pip" by "py -3.9 -m pip" (if you are using Windows) to
install for 3.9 (as an example) (if you have several Python versions
installed). Under Linux, use "python3.9" instead of "py -3.9".

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor