Error: pip install pycapnp - python

I've been trying to install pycapnp via pip on my macbook pro. But I seem to be having issues trying to download it.
The following is the error:
warning: "Your compiler supports C++11 but your C++ standard library does not.
If your " "system has libc++ installed (as should be the case
on e.g. Mac OSX), try adding " "-stdlib=libc++ to your CXXFLAGS."
[-W#warnings]
#warning "Your compiler supports C++11 but your C++ standard library does not.
If your "\
^
/private/var/folders/yv/f6fy_dm51799h6htr1nd30480000gn/T/pip-build-doQpew/
pycapnp/build/include/kj/common.h:78:10: fatal error: 'initializer_list' file
not found
#include <initializer_list>
^
2 warnings and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/
private/var/folders/yv/f6fy_dm51799h6htr1nd30480000gn/T/pip-build-doQpew/pycapnp/
setup.py';f=getattr(tokenize, 'open', open)(__file__);code=
f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
install --record /var/folders/yv/f6fy_dm51799h6htr1nd30480000gn/T/
pip-hawqg0-record/install-record.txt --single-version-externally-managed --compile"
failed with error code 1 in /private/var/folders/yv/f6fy_dm51799h6htr1nd30480000gn/
T/pip-build-doQpew/pycapnp/
Any help would greatly be appreciated. Thank you!

Try to installed it by declaring
➜ export MACOSX_DEPLOYMENT_TARGET=10.10
Or
➜ CFLAGS='-stdlib=libc++' pip install pycapnp
Or
➜ export CXXFLAGS="-stdlib=libc++"
➜ export CFLAGS="-stdlib=libc++"
You can see more details from this issue
By the way, I installed it successfully in virtualenv on my Macbook.

Related

Error while installing notebook using pip

note: I am on linux(ubuntu,mint)
I am trying to install jupyter. But after some searching I realised that the error I have when trying to install jupyter is due to notebook.
So here is the error I have when trying to install notebook using sudo pip install notebook.
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EKmj0F/scandir/setup.py';
f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();
exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-OB5xPr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-EKmj0F/scandir/
If you want here is the whole output of pip install notebook.
Thank for answers in advance.
This is the relevant part of the error message:
_scandir.c:14:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
You need the Python headers:
sudo apt-get install python-dev
Your installation process tries to compile an extension with gcc and you seem to be missing the necessary decencies.

pip install package - failed with error code 1/2

I'm having issues installing pygrib using pip. I tried installing pygrib by using easy_install, and I get a similar error.
Using pip I get this error:
Command "C:\Users\Brandon\AppData\Local\Enthought\Canopy\edm\envs\User\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Brandon\\AppData\\Local\\Temp\\pip-build-veulay9n\\pygrib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Brandon\AppData\Local\Temp\pip-ff_s5247-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Brandon\AppData\Local\Temp\pip-build-veulay9n\pygrib\
Using easy_install I get this error:
c:\users\brandon\appdata\local\enthought\canopy\edm\envs\user\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
pygrib.c(242): fatal error C1083: Cannot open include file: 'grib_api.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
In fact, pygrib is the only package that doesn't work when I try pip or easy_install - it works for any package I try to install. What's going on here and how do I fix this issue?
pygrib is a Python wrapper for libgrib-api. To compile pygrib you need to compile libgrib-abi and install the library and the header files. Download sources from https://software.ecmwf.int/wiki/display/GRIB/Releases.
pygrib includes one or more Python extension modules written in C which need to be compiled as part of the installation, and this C code depends upon some library that provides a header file named "grib_api.h". Find and install that C library, and pygrib installation should then work.

How to fix netifaces module installation for python2.7?

Environment : Kali Linux 2
I started reading this book "Python network programming cookbook" and the writers listed few modules I am gonna need during the book i was able to install all of them except #netifaces, I tried both the "pip install netifaces" and "python setup.py install" methods but both made appear this message:
x86_64-linux-gnu-gcc: error trying to exec 'cc1': execvp: No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-lsf_5N/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-TsHwUh-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-lsf_5N/netifaces
Storing debug log for failure in /root/.pip/pip.log
I tried to install python-dev and all the libraries I could find in previous asked questions here but nothing made it happen
Thank you all for your help
It looks like you are missing gcc, which is needed to compile netifaces.
I've never used Kali Linux before but you should have apt so, you can try: sudo apt-get install gcc to install the missing package.
Hopefully this solves your problem.

Can't install NetworKit

I have been trying to figure out what the problem was for installing this module for a while and I'm stuck. The only related link I could find is here. I type in the command sudo -E pip3 install networkit into the terminal and here is what I am getting.
g++: error: unrecognized command line option '-Qunused-arguments'
g++: error: unrecognized command line option '-Qunused-arguments'
error: command 'g++' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 -c "import setuptools, tokenize;__file__='/private/var/folders/9n/zhnv69nd7sv9fj9gsg64c1p00000gp/T/pip-build-l15ye4xm/networkit/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9n/zhnv69nd7sv9fj9gsg64c1p00000gp/T/pip-25ou5_op-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/9n/zhnv69nd7sv9fj9gsg64c1p00000gp/T/pip-build-l15ye4xm/networkit
I was able to install all the python packages mentioned here using pip. I have python 3.5, installed gcc5 using macports, currently use Cython version 0.23.4, and installed OpenMP through Homebrew. I was able to find answers to most of the problems I ran into, but I can't seem to find one for this.
Edit: which g++ produces /opt/local/bin/g++ and echo ${CXX} produces a blank line

Can't pip install anything requiring C compilation on OSX 10.10 with homebrew python

When I try to pip install things that involve C compilation (Pillow, specifically) I get an odd error:
clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'
error: command 'clang' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip_build_jakob/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip-LnL0hW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip_build_jakob/Pillow
I posted my pip.log for this installation.
I think this problem is due to a combination of OSX 10.10 Yosemite and Homebrew python. Have you experienced this before? ideas on how to fix it?
You need to install XCode in order to be be able to compile on OS X.

Categories

Resources