I changed optimize to 0 in my setup.py file and it fixed the not being able to import .pyc.
On 9/08/2011 10:56 AM, Adam Estes wrote:That can't be correct - py2exe is also creating .pyo files for me in that test - but I can import that module 't' when just the .pyc, or just the .pyo exist.
I am unable to import the .pyc files because py2exe is putting
everything in .pyo form.
Also, I don't understand why py2exe is looking at your "independent" modules at all - isn't the entire point to have py2exe ignore them and just to import them "normally" at runtime? In that case, I don't understand why you are asking how to get py2exe to create .pyc or .pyo versions of those modules - it should not be touching them.
I suggest you take the same sample I did and show us the absolute minimum that demonstrates your problem.