Python 3 and the requests library

Brian brian.from.fl at gmail.com
Mon Feb 9 15:37:00 EST 2015


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

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.

Then I followed your example but ran it against the logging module instead, as that seems to be where the problem lies. 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

$ 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.

Brian



More information about the Python-list mailing list