Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85404
| References | <9b2a1b9d-4f1b-4786-a3a6-2d414074da6f@googlegroups.com> <96003963-8ca1-4b62-811d-05d6f6a5709d@googlegroups.com> <mailman.18576.1423512729.18130.python-list@python.org> <97b23ac0-c363-43d0-815e-198354d39c58@googlegroups.com> |
|---|---|
| From | Zachary Ware <zachary.ware+pylist@gmail.com> |
| Date | 2015-02-09 15:03 -0600 |
| Subject | Re: Python 3 and the requests library |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18579.1423515836.18130.python-list@python.org> (permalink) |
On Mon, Feb 9, 2015 at 2:37 PM, Brian <brian.from.fl@gmail.com> wrote: > Zach, > > Here is what I get on the Mac: > > $ python3 -c "import token;print(token.__file__)" > /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/token.py That looks correct. > Just for grins, I also ran it against the built-in Python 2.7.5 version: > > $ python -c "import token;print(token.__file__)" > /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/token.pyc > > The only difference seems to be that the 2.7.5 version has precompiled it. The 3.4 version is also precompiled, but __file__ gives the filename of the actual module (not the .pyc implementation detail). You can find precompiled token.py for 3.4 at /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/__pycache__/token.cpython-34.pyc > Then I followed your example but ran it against the logging module instead, as that > seems to be where the problem lies. Not so, the traceback you posted shows pretty clearly that the problem is in the tokenize module, where the token module it has imported does not have an __all__ attribute. > Again, for both version (broken 3 and working 2) as a comparison: > > $ python3 -c "import logging;print(logging.__file__)" > /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/__init__.py This should have failed with the same traceback as your test2.py. > $ python -c "import logging;print(logging.__file__)" > /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.pyc > > But nothing is pointing to anything except what appears to be the formally installed > versions of these library modules. Try your test again. If it fails again, run my test again at the same prompt. -- Zach
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Python 3 and the requests library Brian <brian.from.fl@gmail.com> - 2015-02-09 10:11 -0800
Re: Python 3 and the requests library Brian <brian.from.fl@gmail.com> - 2015-02-09 11:20 -0800
Re: Python 3 and the requests library Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-02-09 14:11 -0600
Re: Python 3 and the requests library Brian <brian.from.fl@gmail.com> - 2015-02-09 12:37 -0800
Re: Python 3 and the requests library Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-09 13:58 -0700
Re: Python 3 and the requests library Brian <brian.from.fl@gmail.com> - 2015-02-09 13:37 -0800
Re: Python 3 and the requests library Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-09 15:42 -0700
Re: Python 3 and the requests library Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-02-09 15:03 -0600
csiph-web