Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

One can't proceed from the informal to the formal by formal means.


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

SubjectAuthor
o Re: PythonPath / sys.pathBarry

1
Re: PythonPath / sys.path

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

  copy mid

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

  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: bar...@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: PythonPath / sys.path
Date: Sun, 14 May 2023 17:43:43 +0100
Lines: 88
Message-ID: <mailman.62.1684082707.13552.python-list@python.org>
References: <645F69AC.14631.33F7F4@RealGrizzlyAdams.vivaldi.net>
<12B1206B-7773-4870-B3CC-93126AEEFC70@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de x9lvRHsx50Yvx9m+ebfcawrm4ExPcH1xi+FXiIiZ8okA==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'traceback': 0.04; '(most':
0.05; 'last):': 0.05; '(to': 0.07; 'importerror:': 0.07;
'modules': 0.07; 'python.': 0.08; 'cc:addr:python-list': 0.09;
'from:addr:barry': 0.09; 'received:217.70': 0.09;
'received:217.70.178': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'restart': 0.09; 'skip:[ 60':
0.09; 'cc:no real name:2**0': 0.14; 'help,': 0.14; 'import': 0.15;
'url:mailman': 0.15; '>>>>': 0.16; 'barry': 0.16; 'from:addr
:barrys-emacs.org': 0.16; 'message-id:@barrys-emacs.org': 0.16;
'obsolete': 0.16; 'pointers': 0.16; 'useless': 0.16; 'variable,':
0.16; 'variable.': 0.16; 'wrote:': 0.16; 'problem': 0.16;
'python': 0.16; "can't": 0.17; 'cc:addr:python.org': 0.20;
'version': 0.23; 'command': 0.23; 'run': 0.23; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25;
'tried': 0.26; 'wrong': 0.28; 'environment': 0.29; 'error': 0.29;
'seem': 0.31; 'effect': 0.31; 'module': 0.31; 'url-ip:188/8':
0.31; '"",': 0.32; 'python-list': 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; 'header:In-Reply-To:1': 0.34; 'work,': 0.36;
"skip:' 10": 0.37; 'really': 0.37; 'using': 0.37; 'file': 0.38;
'two': 0.39; 'adding': 0.39; 'setting': 0.39; 'use': 0.39;
'learn': 0.40; 'want': 0.40; 'try': 0.40; 'search': 0.61; 'your':
0.64; 'named': 0.65; 'received:217': 0.67; 'right': 0.68; 'net':
0.69; 'times': 0.69; 'business': 0.77; 'reasons': 0.84; '(other':
0.84; 'adams': 0.91; 'fresh': 0.91
In-Reply-To: <645F69AC.14631.33F7F4@RealGrizzlyAdams.vivaldi.net>
X-Mailer: iPad Mail (20E252)
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: <12B1206B-7773-4870-B3CC-93126AEEFC70@barrys-emacs.org>
X-Mailman-Original-References: <645F69AC.14631.33F7F4@RealGrizzlyAdams.vivaldi.net>
 by: Barry - Sun, 14 May 2023 16:43 UTC

> On 14 May 2023, at 16:32, Grizzy Adams via Python-list <python-list@python..org> wrote:
>
> 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 '->)

I take it you have business reasons to use an obsolete version python.
Where did you get your version of python from?

You seem to be doing the right thing with setting an environment variable.
Useless shades is an app that embeds python.

Try starting cmd.exe and using the set command to liat all of the environment.
Do you see your PYTHONPATH variable?
Does it contain what you expect?
If it does start python and check that sys.path has your folder in it.
Also check what is on os.environ dirctionary.

Barry
>
> Grizz
> --
> https://mail.python.org/mailman/listinfo/python-list
>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor