Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
79 user(s) are online (51 user(s) are browsing Forums)

Members: 0
Guests: 79

more...

Support us!

Headlines

 
  Register To Post  

PYTHONPATH not working as intended on OS4
Quite a regular
Quite a regular


See User information
RAM:test.py:
import runpy

if __name__ == "__main__":
    print 
"Hello"


Ensure there is no value set for PYTHONPATH at the moment:
getenv PYTHONPATH
# should result in nothing


Execute the script:
python test.py
# "Hello"


Set PYTHONPATH:
setenv PYTHONPATH workbench:
# or any location


Ensure that it has been set:
getenv PYTHONPATH
# workbench:


Execute the script:
python test.py
'import site' failed; use -for traceback
Traceback 
(most recent call last):
  
File "test.py"line 1in <module>
    
import runpy
ImportError
No module named runpy


Try also in "sh" - the same issue.

I report this because on OS4Depot it is version 2.4.1, but somehow I have 2.5.6 and I cannot remember where I got that from. I am not sure if 2.5.6 was meant to be more mature than 2.4.1 or whether this is a known issue.

PYTHONPATH is meant to extend - not replace - the searchables.

Go to top
Anonymous
Re: PYTHONPATH not working as intended on OS4
@rjd324

That might be the problem i'm getting with most (if not all) of python scripts...

How did you work around it?
Remove PYTHONPATH completely?

Go to top
Re: PYTHONPATH not working as intended on OS4
Quite a regular
Quite a regular


See User information
I noticed it when invoking a "configure". In the configure it runs a python script and sets PYTHONPATH - now, the native modules installed in Workbench are not visable.

I am working on the configure script now, but I would guess it is going to have to be a hack to also add the native OS4 modules path - as well as - the additional path wanted by the configure script.

Go to top
Re: PYTHONPATH not working as intended on OS4
Quite a regular
Quite a regular


See User information
Since there is no github location, I cannot report an official bug.

Go to top
Anonymous
Re: PYTHONPATH not working as intended on OS4
@rjd324

I have this
Quote:
SYS:System/Python/Lib
in my PYTHONPATH ENVvar.

Trying to get rid of it and see if the python scripts behave again

Go to top
Anonymous
Re: PYTHONPATH not working as intended on OS4
@rjd324

...and yes it does

flawfinder running fine now

Thanks a lot for the hint...

...and now that you mention it, i had a similar problem with PKG_PATH (or something like that), it refused to find perfectly available .pc files while configuring...after the updated SDK was installed, i removed everything SDK related from ENVARC first and the PKG_PATH var wasn't created and i haven't had a hit since...


Seems there is something wrong with adding pathes from envvars?

Go to top
Re: PYTHONPATH not working as intended on OS4
Quite a regular
Quite a regular


See User information
Great news.

At least we know of that bug. Manipulation of PYTHONPATH (and friends) is quite common for PY stuff; even I know that I am by far an expert in PY.

If we had access to the source code for PY2.5.6 we could perhaps have a look and fix it - versus: porting PY from scratch when someone has clearly already done most of the hard work.

Go to top
Re: PYTHONPATH not working as intended on OS4
Quite a regular
Quite a regular


See User information
For the sake of completeness and history:

See also: https://www.amigans.net/modules/newbb/viewtopic.php?topic_id=4187

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1
Pegasos2
X5000
X1000
A1222
Sam 440/460
Classic PowerPC Amiga
WinUAE emulation
Qemu emulation
Total Votes: 158
The poll will close at 2025/12/1 12:00
3 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project