Python files package and Mac Os

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Python files package and Mac Os

Postby Gbadji » Mon Feb 25, 2008 11:30 am

Well, this is the next question from a Mac os writer ;).

Is it necessary to compile python files (like **MyAge**BookGUI.py for example) to include them in **MyAge**.pak?
I'm just getting PlasmaShop and it is running through CrossOver on my Mac but when I'm adding python files in the package, the compilation failed:

Code: Select all
Compiling all uncompiled files...

ERROR:  Either python or the python utilities could not be found.  Please check your configuration and try again.

Done!  Be sure to check the output for errors...


Hrmmm, if I success to compile on Mac OS, my personal maintainers :) couldn't use the package on windows and we will go no where, so it's good the compilation doesn't work.

What is the solution to make the package without compilation? I found no option for that in PlasmaShop :(.

Other question : is it **MyAge**.pak a good name for my package?

Thanks for your help.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
User avatar
Gbadji
 
Posts: 73
Joined: Sat Feb 02, 2008 5:59 am

Re: Python files package and Mac Os

Postby Zrax » Wed Feb 27, 2008 5:20 pm

I believe you can trick it by just removing all the .py source files (so it only has .pyc files), and then adding the .pyc files to the pak... You may want to make a new directory for that though, if you don't want to lose your source ;)
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Python files package and Mac Os

Postby Gbadji » Thu Feb 28, 2008 1:05 am

Aïe, je me suis mal exprimée, je ne veux justement pas des .pyc. Je construit l'âge sur Mac et ma question est : est-ce que c'est possible, peut-on n'utiliser que les fichiers .py pour les fichers python que l'on écrit (comme *MyAge*BookGUI.py), et si oui comment ?

Well, now in english. If someone see some difference, please explain correctly my question.

My first explanation seams to be ambiguous, I build our age on Mac Os so I can't offer the .pyc to my friends. The question is: is it possible to use only .py files from the "writers code" (as *MyAge*BookGUI.py file), if yes, how to do that?

Thanks for your patience and your help.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
User avatar
Gbadji
 
Posts: 73
Joined: Sat Feb 02, 2008 5:59 am

Re: Python files package and Mac Os

Postby jordd » Thu Feb 28, 2008 2:36 pm

Wait. You can make ages on mac now?? :shock: How?
____________________---_________________---_________________---_______________---_______________---______________---______________---
Pneumonoultramicroscopicsilicovolcanoconiosis
its a real word :)
User avatar
jordd
 
Posts: 41
Joined: Sat Oct 27, 2007 12:11 pm

Re: Python files package and Mac Os

Postby Paradox » Thu Feb 28, 2008 4:37 pm

Gbadji wrote:Aïe, je me suis mal exprimée, je ne veux justement pas des .pyc. Je construit l'âge sur Mac et ma question est : est-ce que c'est possible, peut-on n'utiliser que les fichiers .py pour les fichers python que l'on écrit (comme *MyAge*BookGUI.py), et si oui comment ?

Well, now in english. If someone see some difference, please explain correctly my question.

My first explanation seams to be ambiguous, I build our age on Mac Os so I can't offer the .pyc to my friends. The question is: is it possible to use only .py files from the "writers code" (as *MyAge*BookGUI.py file), if yes, how to do that?

Thanks for your patience and your help.


Ca ne fait pas de difference si les fichiers .py sont compiles sur un Mac ou sur un PC (moi, j'utilise Ubuntu Linux). Le problem c'est que PlasmaShop est ecrit pour Windows, alors il cherche le programme Python.exe. C'est peut-etre possible de faire compiler les fichiers sur Mac, et puis (comme Zrax a dit) metter seulment les fichiers .pyc dans le .pak avec PlasmaShop.

========
It doesn't make a difference whether the .py files are compiled on a Mac or on a PC (I use Ubuntu Linux). The problem is that PlasmaShop is designed for Windows, so it's looking for Python.exe. It might be possible to manually compile the files on Mac, and then (as Zrax said) pack only the .pyc files into a .pak.
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Python files package and Mac Os

Postby Gbadji » Fri Feb 29, 2008 1:49 am

Thanks for this good news Paradox. I haven't correctly understood the Zrax's answer :oops: . I thought the compiled files were different as for others languages.

Jordd, I'm trying ;) but keep in mind we can't play (yet ? :? ). To build ages on Mac you have to follow what is required here taking the Mac Os versions for the tools ;) (for blender be sure to take the version for Python 2.5 -- I had some problem with that, I didn't seen the good one the first time).

My next step is to build the .pak file to add some interaction between the avatar and the environment but except that (and our blender problems) the âge work correctly.

Now I go to see how to compile my .py files.
See you soon.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
User avatar
Gbadji
 
Posts: 73
Joined: Sat Feb 02, 2008 5:59 am

Re: Python files package and Mac Os

Postby Gbadji » Fri Feb 29, 2008 4:45 am

Some time, days begin in a good way. Today is one of that days. But it will be a long day because I have to wait my friends test my first book in our age and send me the result. (I have to find a solution for that too, but it's not our purpose here).

Yes, you understand well, I build the .pak file.

What I done? Finally it was simple (too simple ? maybe, I'm looking always for the more complicated solution ;) )

1/ I taken my .pyc files using
Code: Select all
#!/usr/local/bin/python

import py_compile

py_compile.compile("MystpediaBookGUI.py")
py_compile.compile("MystpediaJournals.py")
py_compile.compile("MystpediaPageDefs.py")


2/ I tried to add them in a .pak with PlasmaShop. I got the same error log:
Code: Select all
Compiling all uncompiled files...

ERROR:  Either python or the python utilities could not be found.  Please check your configuration and try again.

Done!  Be sure to check the output for errors...


3/ I remembered Paradox speaking about python.exe, so I taken a look at the Preference dialog box and wrote my python interpreter path (/usr/local/bin/python) in it.

4/ I tried again to add the .pyc files in the .pak ==> it's working.

5/ I tried to add .py files in a new package to see if it could be working now ==> no, I can't find the .pyc and .pak created on this step.

So keeping steps 1, 3 and 4 we can make .pak in Mac Os (/dance).

See you,
I'm going to check my email box :lol:.

*********** EDIT ************
(I can't made a third post :) )

I have my answer, the package change nothing :( . So I have missed some thing some where.
What name for the .pak file? I presumed if my age name is MyAge.age, the package must be named MyAge.pak. Is it correct?

Is it somewhere in the .blend file to write the package name?

Thanks.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
User avatar
Gbadji
 
Posts: 73
Joined: Sat Feb 02, 2008 5:59 am

Re: Python files package and Mac Os

Postby Paradox » Fri Feb 29, 2008 4:27 pm

What version of Python are you using?

PyPRP and Blender need 2.5
Uru needs 2.2

You need to compile the files with Python 2.2
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Python files package and Mac Os

Postby Gbadji » Sat Mar 01, 2008 8:20 am

Paradox, I prefer when you send me good news :). You're right, I missed that information.

I'm not sure it's necessary to ask the question but maybe ... :?: is it possible to install both versions in Mac Os ?

The better solution would be to take my husband's PC (with windows) and keep it for me :D.

See you soon.
The French's Mystpedia age Project - http://www.mystpedia.net
To find me in the Cavern: Gbadji KI #6911493 or Alatan KI#7869109
User avatar
Gbadji
 
Posts: 73
Joined: Sat Feb 02, 2008 5:59 am

Re: Python files package and Mac Os

Postby Zrax » Wed Mar 05, 2008 12:02 am

It's possible to install both versions of Python on both Windows and Linux, so I would *assume* it's also possible on Mac OS, but I don't have a Mac to test this on. The best answer would be to just try it and see what happens ;)
User avatar
Zrax
 
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests