I am trying to install ios-deploy on Mac OS High Sierra 10.13.2 by running cnpm install -g ios-deploy and it end up with this error message: - appium-ios

fangyongteng$ cnpm install -g ios-deploy Downloading ios-deploy to
/usr/local/lib/node_modules/ios-deploy_tmp Copying
/usr/local/lib/node_modules/ios-deploy_tmp/_ios-deploy#1.9.2#ios-deploy
to /usr/local/lib/node_modules/ios-deploy Installing ios-deploy's
dependencies to /usr/local/lib/node_modules/ios-deploy/node_modules
scripts.preinstall ios-deploy#1.9.2 "./src/scripts/check_reqs.js &&
xcodebuild" stderr: xcode-select: error: tool 'xcodebuild' requires
Xcode, but active
developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Install fail! Error: Run "sh -c ./src/scripts/check_reqs.js &&
xcodebuild" error, exit code 1
Error: Run "sh -c ./src/scripts/check_reqs.js && xcodebuild" error,
exit code 1
at ChildProcess.proc.on.code (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:74:21)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) npminstall version: 3.3.0 npminstall
args: /usr/local/Cellar/node/9.3.0_1/bin/node
/usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js
--china --userconfig=/Users/fangyongteng/.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=http://registry.npm.taobao.org -g ios-deploy

I also have the same problem, and my solution is use sudo xcode-select --reset

I carried out this statement solves this problem: sudo xcode - select - switch/Applications/Xcode9.2 app/Contents/Developer

Related

"How to fix 'error: command 'gcc' failed with exit status 1' while installing "SudachiPy" python package?

I am working in building Japanese NLP sentiment analysis, to tokenise the Japanese sentence we have a package called "SudachiPy".I tried to install it but I am getting error while installing the package. I'm using anaconda in MAC Book pro.
I tried all the steps mentioned in stack overflow by installing following libraries to debug the error.
pip3 install python3-dev
Also I tried launching an "Ubuntu" instance from AWS and try to install "SudachiPy" but still encountering the same error.
pip3 install SudachiPy
Building wheels for collected packages: dartsclone
Building wheel for dartsclone (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/setup.py'"'"'; __file__='"'"'/private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-wheel-x8k1ryul --python-tag cp36
cwd: /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/dartsclone
copying dartsclone/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/dartsclone
running build_ext
cythoning dartsclone/_dartsclone.pyx to dartsclone/_dartsclone.cpp
/anaconda3/lib/python3.6/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/dartsclone/_dartsclone.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
warning: dartsclone/_dartsclone.pyx:119:49: local variable 'result' referenced before assignment
warning: dartsclone/_dartsclone.pyx:120:15: local variable 'result' referenced before assignment
building 'dartsclone._dartsclone' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/dartsclone
creating build/temp.macosx-10.7-x86_64-3.6/csrc
creating build/temp.macosx-10.7-x86_64-3.6/csrc/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I./csrc/include -I/anaconda3/include/python3.6m -c dartsclone/_dartsclone.cpp -o build/temp.macosx-10.7-x86_64-3.6/dartsclone/_dartsclone.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
dartsclone/_dartsclone.cpp:610:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for dartsclone
You need to install some deps before, similar to Linux build-essential:
xcode-select install
Also, you may need to specify the right compiler, by setting this env. variable:
CFLAGS='-stdlib=libc++'

airflow install fails when using pipenv

I'm trying to install python package airflow into a virtualenv that has been created using pipenv, inside a docker container. It fails with an error that I'm clueless about.
Here is my Dockerfile:
FROM python:3.6-stretch
WORKDIR /tmp
# Define build args
ARG http_proxy
ARG https_proxy
ARG no_proxy
RUN apt-get update && \
apt-get -y install default-jdk
# Detect JAVA_HOME and export in bashrc.
# This will result in something like this being added to /etc/bash.bashrc
# export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
RUN echo export JAVA_HOME="$(readlink -f /usr/bin/java | sed "s:/jre/bin/java::")" >> /etc/bash.bashrc
# Upgrade pip
RUN pip install --upgrade pip
# Install core python packages
RUN pip install pipenv==2018.5.18
Build and run:
docker build -t pipenvtest:latest .
docker run -it pipenvtest:latest bash
When connected to the container:
pipenv --python 2.7
pipenv install --dev airflow
Which fails with this error:
building '_yaml' extension
creating build/temp.linux-x86_64-2.7/ext
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o
ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
(the ^ actually appears at the end of the line preceding it but I don't know how to format the quoted text as such)
I admit to not having the faintest idea how to go about solving this so hoping someone can give me some pointers. I hope the repro that I've included here works for you.
Is the --dev switch in pipenv install --dev airflow intended? It instructs pipenv to install development dependencies of Airflow too. One of these dependencies needs the Python.h header file (which is missing). To resolve the problem:
If you do not need the development dependencies then
remove the --dev switch.
If you need the development
dependencies then install the libpython2.7-dev package, which
provides Pthon.h, before you install Aiflow: apt install libpython2.7-dev
OK, I was being really dumb. I was trying to setup a python2.7 virtualenv on an image built from python:3.6-stretch.
I changed
pipenv --python 2.7
to
pipenv --python 3.6
and it worked.

Meteor deploy (mup) running into errors

-----------------------------------STDERR-----------------------------------
The command '/bin/sh -c cd /built_app/programs/server && npm install --unsafe-perm' returned a non-zero code: 1
-----------------------------------STDOUT-----------------------------------
rget/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
make: Leaving directory '/built_app/programs/server/npm/node_modules/bcrypt/build'
npm ERR! Invalid version: "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz"
I am running into an error with bcrypt.
My bcrypt version: ^0.8.7
My meteor version: 1.6.0.1
mup has some problems with meteor 1.6. Try yamup (yet another mup):
npm install -g yamup
cp mup.json yamup.json
yamup deploy

Error setting up environment on Google Cloud Shell to use Cloud ML

Following instructions from https://cloud.google.com/ml/docs/how-tos/getting-set-up:
Created a project and started the Cloud Shell.
Ran below script to Install required tools and dependencies
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Expected outcome >>
"Success! Your environment has the required tools and dependencies." when the script finishes successfully.
Actual outcome >>
+ pip install --user --upgrade 'pillow>=3.4.2' --global-option=build_ext --global-option=--disable-jpeg
/usr/local/lib/python2.7/dist-packages/pip-8.1.1- py2.7.egg/pip/commands/install.py:180: UserWarning: Disabling all use of wheels due to the use of --build-options / --g
lobal-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pillow>=3.4.2
Using cached Pillow-4.0.0.tar.gz
Collecting olefile (from pillow>=3.4.2)
Using cached olefile-0.43.zip
Installing collected packages: olefile, pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-vers
ion-externally-managed --compile --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --disable-jpeg not recognized
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-version- externally-managed -
-compile --user --prefix=" failed with error code 1 in /tmp/pip-build- KwQqVS/olefile/
I had the same problem and I solved it.
The error came from Pilow.
First you should install Pillow seperately: (with sudo)
sudo pip install --upgrade pillow
Then you run again the command:
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Everything will be ok.
The fix has been pushed to Github, the new version did
pip install --user --upgrade pillow,
which doesn't have the '--disable-jpeg' option. It seems that the new version of Pillow fixed the issue mentioned in Fail during installation of Pillow (Python module) in Linux and removed the option.

Install therubyracer on OSX

I have a fresh install of ruby 2.1.1, a clean set of gem and I reinstalled V8 with homebrew but I get this 'unrecognized command line option' error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/jspooner/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling accessor.cc
g++: error: unrecognized command line option '-rdynamic'
make: *** [accessor.o] Error 1
make failed, exit code 2
g++ version
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.3/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin13.2.0
Configured with: ../configure --build=x86_64-apple-darwin13.2.0 --prefix=/usr/local/Cellar/gcc/4.8.3 --enable-languages=c,c++,objc,obj-c++,fortran --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (GCC)
if Ubuntu users having this situation (e.g.: on a Ubuntu VM)
gem install therubyracer -v '0.11.4'
\Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/home/deploy/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
checking for main() in -lpthread... yes
creating Makefile
make "DESTDIR="
compiling accessor.cc
make: g++: Command not found
make: *** [accessor.o] Error 127
Gem files will remain installed in /home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.4 for inspection.
Results logged to /home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.4/ext/v8/gem_make.out
Ubuntu solution:
sudo apt-get install build-essential g++
I had to run brew update gcc.
brew upgrade gcc
==> Upgrading 1 outdated package, with result:
gcc 4.9.1
==> Upgrading gcc
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/gcc-4.9.1.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring gcc-4.9.1.mavericks.bottle.2.tar.gz
==> Caveats
GCC has been built with multilib support. Notably, OpenMP may not work:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670
If you need OpenMP support you may want to
brew reinstall gcc --without-multilib
==> Summary
🍺 /usr/local/Cellar/gcc/4.9.1: 1152 files, 203M
Changing the symbolic link of g++ and gcc worked for me on Mac OS 10.10.
ls -al /opt/local/bin/gcc
ls -al /opt/local/bin/g++
sudo rm /opt/local/bin/gcc
sudo rm /opt/local/bin/g++
sudo ln -s /usr/bin/llvm-gcc /opt/local/bin/gcc
sudo ln -s /usr/bin/llvm-g++ /opt/local/bin/g++
gem install therubyracer -v '0.12.1'
sudo rm /opt/local/bin/g++
sudo rm /opt/local/bin/gcc
sudo ln -s /opt/local/bin/g++-mp-4.9 /opt/local/bin/g++
sudo ln -s /opt/local/bin/gcc-mp-4.9 /opt/local/bin/gcc

Resources