Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29614

Python 3.3 and .pyo files

From Marco <nameDOTsurname@gmail.com>
Newsgroups comp.lang.python
Subject Python 3.3 and .pyo files
Date 2012-09-21 11:10 +0200
Organization Aioe.org NNTP Server
Message-ID <k3hatd$kto$1@speranza.aioe.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Python 3.3 and .pyo files Marco <nameDOTsurname@gmail.com> - 2012-09-21 11:10 +0200
  Re: Python 3.3 and .pyo files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-21 12:55 +0000
    Re: Python 3.3 and .pyo files Marco <nameDOTsurname@gmail.com> - 2012-09-21 17:27 +0200
  Re: Python 3.3 and .pyo files Terry Reedy <tjreedy@udel.edu> - 2012-09-21 22:46 -0400
    Re: Python 3.3 and .pyo files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-22 13:21 +0000
      Re: Python 3.3 and .pyo files Ramchandra Apte <maniandram01@gmail.com> - 2012-09-22 07:01 -0700
      Re: Python 3.3 and .pyo files Terry Reedy <tjreedy@udel.edu> - 2012-09-22 18:54 -0400
  Re: Python 3.3 and .pyo files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-27 02:25 +0000

csiph-web