From 20a0592b37bba8db2cf7606ca21f6019f7b829a3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 21 Aug 2015 23:09:56 +0300 Subject: [PATCH] Fix "AttributeError: 'module' object has no attribute 'packages'" // Resolve #252 --- HISTORY.rst | 7 +++++++ docs/faq.rst | 5 +++++ platformio/__init__.py | 2 +- platformio/__main__.py | 11 ++++++++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6623fa7b..3d03dc5c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,13 @@ Release History `atmelavr `__ platform (`pull #256 `_) +* Updated ``tool-teensy`` for `Teensy `__ + platform + (`issue #268 `_) +* Fixed includes list for Windows OS when generating project for `Eclipse IDE `__ + (`issue #270 `_) +* Fixed ``AttributeError: 'module' object has no attribute 'packages'`` + (`issue #252 `_) 2.2.2 (2015-07-30) ------------------ diff --git a/docs/faq.rst b/docs/faq.rst index f103986b..62bf6d5b 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -101,6 +101,11 @@ Please upgrade *SetupTools* package: $ [sudo] pip uninstall platformio $ [sudo] pip install platformio +Windows: ``AttributeError: 'module' object has no attribute 'packages'`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Answered in `issue #252 `_. + ARM toolchain: ``cc1plus: error while loading shared libraries`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 3f7f72eb..9988d3fd 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "0.dev2") +VERSION = (2, 3, "0a1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/__main__.py b/platformio/__main__.py index a298502e..b6f88342 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -70,7 +70,16 @@ def main(): try: # https://urllib3.readthedocs.org # /en/latest/security.html#insecureplatformwarning - requests.packages.urllib3.disable_warnings() + try: + requests.packages.urllib3.disable_warnings() + except AttributeError: + click.secho( + "Invalid installation of Python `requests` package`. See " + "< https://github.com/platformio/platformio/issues/252 >", + fg="red", err=True + ) + return 1 + cli(None, None) except Exception as e: # pylint: disable=W0703