Fix installation on Mac OS X El Capitan // Resolve #312

This commit is contained in:
Ivan Kravets
2015-11-06 16:38:41 +02:00
parent bf9bbabfd6
commit d72b899471
4 changed files with 19 additions and 18 deletions

View File

@ -21,6 +21,8 @@ PlatformIO 2.0
* Fixed firmware uploading for `nordicrf51 <http://docs.platformio.org/en/latest/platforms/nordicnrf51.html>`__
development platform
(`issue #316 <https://github.com/platformio/platformio/issues/316>`_)
* Fixed installation on Mac OS X El Capitan
(`issue #312 <https://github.com/platformio/platformio/issues/312>`_)
2.3.4 (2015-10-13)
~~~~~~~~~~~~~~~~~~

View File

@ -92,8 +92,8 @@ Troubleshooting
Installation
~~~~~~~~~~~~
PlatformIO and ``scons`` aren't installed properly
''''''''''''''''''''''''''''''''''''''''''''''''''
PlatformIO and SCons aren't installed properly
''''''''''''''''''''''''''''''''''''''''''''''
Try these solutions:
@ -104,7 +104,7 @@ Try these solutions:
[sudo] pip uninstall scons
[sudo] pip install scons
# if you have "error: option --single-version-externally-managed not recognized", then
# or if you have "error: option --single-version-externally-managed not recognized"
[sudo] pip install --egg scons
2. Install PlatformIO using :ref:`installation_installer_script`.

View File

@ -41,7 +41,7 @@ Please *choose one of* the following installation options:
Python Package Manager
~~~~~~~~~~~~~~~~~~~~~~
The latest stable version of PlatformIO may be done via
The latest stable version of PlatformIO may be installed/upgraded via
`pip <https://pip.pypa.io>`_ as follows:
.. code-block:: bash
@ -52,9 +52,6 @@ The latest stable version of PlatformIO may be done via
# install/upgrade the latest version of PlatformIO
pip install -U platformio
.. warning::
Known Issue: :ref:`faq_troubleshooting_sconssingverextmanaged`
Note that you may run into permissions issues running these commands. You have
a few options here:

View File

@ -62,11 +62,11 @@ def exec_command(*args, **kwargs):
if p.returncode != 0:
raise Exception("\n".join([out, err]))
return out
return out.strip()
def exec_python_cmd(args):
return exec_command([CURINTERPRETER_PATH] + args).strip()
return exec_command([CURINTERPRETER_PATH] + args)
def install_pip():
@ -86,18 +86,20 @@ def install_pip():
os.unlink(f.name)
def install_pypi_packages(packages):
print (exec_python_cmd([
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
"install", "-U"] + packages))
def install_platformio():
cmd = ["-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip"]
try:
print (exec_python_cmd(cmd + ["install", "-U", "platformio"]))
except Exception:
print (exec_python_cmd(
cmd + ["--no-cache-dir", "install", "-U", "platformio"]))
def main():
steps = [
("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []),
("Installing Python Package Manager", install_pip, []),
("Installing PlatformIO and dependencies", install_pypi_packages,
[["setuptools", "platformio"]])
("Fixing Windows %PATH% Environment", fix_winpython_pathenv),
("Installing Python Package Manager", install_pip),
("Installing PlatformIO and dependencies", install_platformio)
]
if not IS_WINDOWS:
@ -109,7 +111,7 @@ def main():
break
print ("\n==> %s ..." % s[0])
try:
s[1](*s[2])
s[1]()
print ("[SUCCESS]")
except Exception, e:
is_error = True