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


Groups > comp.lang.python > #85400

Re: Python 3 and the requests library

References <9b2a1b9d-4f1b-4786-a3a6-2d414074da6f@googlegroups.com> <96003963-8ca1-4b62-811d-05d6f6a5709d@googlegroups.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date 2015-02-09 14:11 -0600
Subject Re: Python 3 and the requests library
Newsgroups comp.lang.python
Message-ID <mailman.18576.1423512729.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Feb 9, 2015 at 1:20 PM, Brian <brian.from.fl@gmail.com> wrote:
> I am also seeing this in my Mac Mavericks Python 3 installation when I use just the built-in logging library. Again, a tiny example executable script and the results:
>
> $ cat test2.py
> #!/usr/bin/env python3
> import logging
> logging.info("TEST2 starting")
>
> $ ./test2.py
> Traceback (most recent call last):
>   File "./test2.py", line 3, in <module>
>     import logging
>   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/logging/__init__.py", line 26, in <module>
>     import sys, os, time, io, traceback, warnings, weakref, collections
>   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/traceback.py", line 3, in <module>
>     import linecache
>   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/linecache.py", line 10, in <module>
>     import tokenize
>   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tokenize.py", line 40, in <module>
>     __all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
> AttributeError: 'module' object has no attribute '__all__'
>
> Googling hasn't helped track this one down. In lieu of an answer, some pointers to tools or other things to look for would be greatly appreciated. Thanks!

Try this, from wherever test2.py lives:

python3 -c "import token;print(token.__file__)"

You should get back something akin to "/usr/lib64/python3.4/token.py"
(however that translates to Mac).  If instead you get the path to some
file of your own, rename your file.

Hope this helps,
-- 
Zach

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


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