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>`__ * Fixed firmware uploading for `nordicrf51 <http://docs.platformio.org/en/latest/platforms/nordicnrf51.html>`__
development platform development platform
(`issue #316 <https://github.com/platformio/platformio/issues/316>`_) (`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) 2.3.4 (2015-10-13)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -92,8 +92,8 @@ Troubleshooting
Installation Installation
~~~~~~~~~~~~ ~~~~~~~~~~~~
PlatformIO and ``scons`` aren't installed properly PlatformIO and SCons aren't installed properly
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
Try these solutions: Try these solutions:
@ -104,7 +104,7 @@ Try these solutions:
[sudo] pip uninstall scons [sudo] pip uninstall scons
[sudo] pip install 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 [sudo] pip install --egg scons
2. Install PlatformIO using :ref:`installation_installer_script`. 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 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: `pip <https://pip.pypa.io>`_ as follows:
.. code-block:: bash .. code-block:: bash
@ -52,9 +52,6 @@ The latest stable version of PlatformIO may be done via
# install/upgrade the latest version of PlatformIO # install/upgrade the latest version of PlatformIO
pip install -U 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 Note that you may run into permissions issues running these commands. You have
a few options here: a few options here:

View File

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