Mbed-cli: python setup.py install fails on my OS X machine

Created on 24 May 2016  路  14Comments  路  Source: ARMmbed/mbed-cli

Relatively fresh machine:

janjon01:~/repos/mbed-cli (master) $ python setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/test-easy-install-70456.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
documentation unable to reproduce

Most helpful comment

Have you tried sudo python setup.py install?

All 14 comments

mkdir /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

fixes it

Have you tried sudo python setup.py install?

@screamerbg No, site-packages folder does not exist. python2.7 folder above it does. Should add a mkdir -p or something.

@janjongboom mbed CLI is not in control of packages (in fact it doesn't touch any of that functionality). Perhaps this should be explained in the documentation? @bogdanm @iriark01

Also note that I didn't face that problem on my Mac. I'm using the native (non port) Python.

@screamerbg Then who is?

setup.py uses the native setuptools.setup() routine. It's something built in Python. mbed CLI doesn't do any "magic" to install itselfs. See the contents of the setup.py file.

$ cat setup.py 
# Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
import os
from setuptools import setup

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name="mbed-cli",
    packages=["mbed"],
    version="0.3.2",
    url='http://github.com/ARMmbed/mbed-cli',
    author='ARM mbed',
    author_email='[email protected]',
    license='Apache-2.0',
    entry_points={
        'console_scripts': [
            'mbed=mbed.mbed',
            'mbed-cli=mbed.mbed',
            'neo=mbed.mbed'
        ]
    },
    long_description=read('pypi_readme.rst'),
)

So is there or isn't there a problem?

@iriark01 there is problem in Python (though I can't reproduce on my setup), not in mbed CLI. We can still indicate the workaround in the documentation.

In that case, right after the command that raises the issue, add:

Note: On some machines, you may get the following error message:
[show the error message]
This is due to missing Python packages. To fix the issue, please run:
[show the command]

Here is a rant:

We have some much f&@* problems with yotta installations, which always were waved away with: 'yeah thats some other package' or 'thats not our fault, but thats because bla'. In the end: users cannot install yotta in one go. I tried it today, failed again on a fresh Raspberry Pi. We're recreating the same exact atmosphere here again straight from the start. I am a _real_ user of mbed-cli on a _real_ machine with a _real_ environment, and issues are waved away again as 'well, not our problem'. OF COURSE THIS IS OUR PROBLEM. This is a fundamental piece of infrastructure. Every real world error when installing our tools should be top priority.

@janjongboom can you try with PR #189 ?

ping @janjongboom

@screamerbg @sg- Well, I can't really reproduce that issue anymore given that I have mbed-cli installed right now...

Right, so, see here : https://github.com/ARMmbed/mbed-cli/issues/218

tldr;
We should have two channels, public and development. Public things are compiled binaries or .apps that just work and we can guarantee the experience on. The dev channel will be the python pip install, which is the freshest and most up to date, but also comes with no guarantee's of working or support at all. Just my 2 cents from the yotta debacle.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmonr picture cmonr  路  3Comments

SeppoTakalo picture SeppoTakalo  路  10Comments

bmcdonnell-ionx picture bmcdonnell-ionx  路  5Comments

masoudr picture masoudr  路  3Comments

maclobdell picture maclobdell  路  3Comments