mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fix SConsNotInstalled
error for Linux Debian-based distributives
This commit is contained in:
@ -4,6 +4,11 @@ Release History
|
||||
PlatformIO 2.0
|
||||
--------------
|
||||
|
||||
2.3.2 (2015-09-??)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Fixed `SConsNotInstalled` error for Linux Debian-based distributives
|
||||
|
||||
2.3.1 (2015-09-06)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -47,7 +47,7 @@ The latest stable version of PlatformIO may be done via
|
||||
.. code-block:: bash
|
||||
|
||||
# update dependent packages to the latest versions
|
||||
pip install -U pip setuptools
|
||||
pip install -U pip setuptools virtualenv
|
||||
|
||||
# install the latest version of PlatformIO
|
||||
pip install -U platformio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 3, "2.dev0")
|
||||
VERSION = (2, 3, "2.dev1")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -6,13 +6,16 @@ try:
|
||||
except ImportError:
|
||||
import sys
|
||||
for p in sys.path:
|
||||
_new_path = None
|
||||
if not p.endswith("site-packages") and "site-packages" in p:
|
||||
_new_path = p[:p.rfind("site-packages") + 13]
|
||||
elif "platformio" in p:
|
||||
_new_path = p[:p.rfind("platformio") - 1]
|
||||
if _new_path and _new_path not in sys.path:
|
||||
sys.path.insert(0, _new_path)
|
||||
_new_paths = []
|
||||
for item in ("dist-packages", "site-packages"):
|
||||
if not p.endswith(item) and item in p:
|
||||
_new_paths.append(p[:p.rfind(item) + len(item)])
|
||||
if "platformio" in p:
|
||||
_new_paths.append(p[:p.rfind("platformio") - 1])
|
||||
|
||||
for _p in _new_paths:
|
||||
if _p not in sys.path:
|
||||
sys.path.insert(0, _p)
|
||||
try:
|
||||
from platformio import util
|
||||
break
|
||||
|
@ -4,6 +4,7 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from glob import glob
|
||||
from imp import load_source
|
||||
from os.path import isdir, isfile, join
|
||||
|
||||
@ -400,6 +401,22 @@ class BasePlatform(object):
|
||||
def test_scons():
|
||||
try:
|
||||
r = util.exec_command(["scons", "--version"])
|
||||
if "ImportError: No module named SCons.Script" in r['err']:
|
||||
_PYTHONPATH = []
|
||||
for p in sys.path:
|
||||
if not p.endswith("-packages"):
|
||||
continue
|
||||
for item in glob(join(p, "scons*")):
|
||||
if isdir(join(item, "SCons")) and item not in sys.path:
|
||||
_PYTHONPATH.append(item)
|
||||
sys.path.insert(0, item)
|
||||
if _PYTHONPATH:
|
||||
_PYTHONPATH = str(os.pathsep).join(_PYTHONPATH)
|
||||
if os.getenv("PYTHONPATH"):
|
||||
os.environ['PYTHONPATH'] += os.pathsep + _PYTHONPATH
|
||||
else:
|
||||
os.environ['PYTHONPATH'] = _PYTHONPATH
|
||||
r = util.exec_command(["scons", "--version"])
|
||||
assert r['returncode'] == 0
|
||||
return True
|
||||
except (OSError, AssertionError):
|
||||
|
Reference in New Issue
Block a user