Python 3.3 and .pyo files

Marco nameDOTsurname at gmail.com
Fri Sep 21 05:10:07 EDT 2012


I was trying to import a pyo module in Python 3.3, but Python does not 
find it:

$ echo "print(__file__)" > foo.py
$ python3.3 -O -m foo
/home/marco/temp/foo.py
$ ls
foo.py  __pycache__
$ rm foo.py
$ mv __pycache__/foo.cpython-33.pyo foo.pyo
$ rm __pycache__ -r
$ ls
foo.pyo
# The following works in Python3.2, but not in 3.3
$ python3.3 -O -m foo
/usr/local/bin/python3.3: No module named foo

How come? Thanks in advance, Marco

-- 
Marco



More information about the Python-list mailing list