English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 03 July 2021, 20:48   #1
JJ__
Registered User
 
Join Date: Jan 2021
Location: UK
Posts: 53
Python v2.4

Hi All,

Following on from JOTD's suggestion, I installed Python 2.4 on my A1200.

I followed the instructions in the article from the 'Tech Cowboy' link here ... https://cowboy3398.wordpress.com/202...-2-4-on-amiga/

I managed to compile a simple program, but at the top of the output page I always get "'Import file' failed: use -v for traceback". Now the program does still run fine, but the message is a bit annoying and I'd like to sort it out. From doing a bit of digging online, it seems to be connected with the environment settings ... following the advice in the article my user-startup file had the following added...

BEGIN Python;
Alias Python Programs:Programming/Python2.4-m68k-amigaos/bin/python2.4
SETENV PYTHONHOME Programs:Programming/Python2.4-m68k-amigaos/lib/Python2.4
SETENV PYTHONPATH $PYTHONHOME
'END Python

Is there anyone with an idea of how to fix that error when compiling please?

On another note, in general, how do we know what version a particular library file is ... I replaced my existing ixemul.library and ixnet.library files when following the installation article obtaining the replacement ones from Aminet (http://aminet.net/package/util/libs/ixemul-48.0), but interestingly the size of the replacement files were smaller than the ones I had installed already. So I'd like to know which versions my library files are if possible. Does a larger library file size always mean a newer version?

Thanks in advance for any help on this.
JJ__ is offline  
Old 03 July 2021, 22:20   #2
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
I also have installed Python 2.4 with help of "Tech Cowboy's" tutorial and could'nt get rid of that message you refer too.
I noted that, with version 2.4 of python, it allways give an error when try to import modules and I think that is relationated with the message "Import file failed" at initialization.
In version 3.3.6 all works fine.
AlfaRomeo is offline  
Old 03 July 2021, 22:31   #3
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
run it with -v option and post traceback
jotd is offline  
Old 03 July 2021, 23:01   #4
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Quote:
Originally Posted by jotd View Post
run it with -v option and post traceback
7.System:> python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site

I didnĀ“t even find any modules folder

Last edited by AlfaRomeo; 03 July 2021 at 23:11.
AlfaRomeo is offline  
Old 03 July 2021, 23:37   #5
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
seems that you were almost there:

https://stackoverflow.com/questions/...ite-on-windows

Code:
SETENV PYTHONHOME Programs:Programming/Python2.4-m68k-amigaos/lib/Python2.4
SETENV PYTHONPATH $PYTHONHOME
that looks like it, but check if you have a "site.py" file in Programs:Programming/Python2.4-m68k-amigaos/lib/Python2.4. If it's somewhere else, set PYTHONHOME to that instead.

or create an empty "site.py" file. This only defines default encoding AFAIR...
jotd is offline  
Old 03 July 2021, 23:53   #6
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Thanks for the help
AlfaRomeo is offline  
Old 04 July 2021, 10:46   #7
JJ__
Registered User
 
Join Date: Jan 2021
Location: UK
Posts: 53
Quote:
Originally Posted by jotd View Post
seems that you were almost there:

https://stackoverflow.com/questions/...ite-on-windows

Code:
SETENV PYTHONHOME Programs:Programming/Python2.4-m68k-amigaos/lib/Python2.4
SETENV PYTHONPATH $PYTHONHOME
that looks like it, but check if you have a "site.py" file in Programs:Programming/Python2.4-m68k-amigaos/lib/Python2.4. If it's somewhere else, set PYTHONHOME to that instead.

or create an empty "site.py" file. This only defines default encoding AFAIR...
Thanks for looking into this JOTD, but unfortunately site.py does already exist in the python lib folder, but I still get that error. Never mind and I'll probably settle to live with it to be honest.

Cheers anyway!
JJ__ is offline  
Old 04 July 2021, 11:55   #8
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Maybe SnoopDos will help to find where it tries to access the "site" import.
daxb is offline  
Old 04 July 2021, 12:37   #9
JJ__
Registered User
 
Join Date: Jan 2021
Location: UK
Posts: 53
Quote:
Originally Posted by daxb View Post
Maybe SnoopDos will help to find where it tries to access the "site" import.
Cheers for the tip ... if I can work it out I'll post again with the answer :-)
JJ__ is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python for Amiga ? macce2 Amiga scene 118 05 December 2021 15:08
Python V1.4 JJ__ Coders. Language 5 01 July 2021 20:34
Python 1 joystick ladybird Retrogaming General Discussion 3 08 August 2007 15:06
Python Joysticks ? blade002 MarketPlace 11 18 June 2006 04:48
Monty Python Bueller request.Demos 2 12 October 2005 16:39

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:23.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09784 seconds with 13 queries