Installing PyAudio on Windows 10 error
I want to install PyAudio
I have Windows 10, Python 3.7, pip 8.1
I'm installing it in Command Prompt with command pip install PyAudio
But there's an error error: command 'D:\\VisualStudio2017\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
Command "c:\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-is1aobj6\\pyaudio\\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\USER\AppData\Local\Temp\pip-record-50bh4kz0\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-install-is1aobj6\pyaudio\
Here's a
screenshot
Thanks for reading my question. I hope you can help :D
Well, I've had just this problem when I wanted to install pylisten (which has PyAudio as a dependency).
There are two problems here - first, your MSVC can't find portaudio.h and after that there will be a problem with the min macro when building. But first things first.
Get portaudio
This is a C dependency for PyAudio, so you need to have include files, in particular portaudio.h like you see on the screenshot. It's possible to get binaries for Windows, but if your using Anaconda, the simplest way to do it is to install it using conda:
(base) C:\> conda search portaudio
Loading channels: done
# Name Version Build Channel
portaudio 19.6.0 h0c8e037_3 pkgs/main
portaudio 19.6.0 hfa6e2cd_3 pkgs/main
(base) C:\> conda install portaudio
(...)
Next, we would like to know where the files from portaudio library actually went. There is no conda package --list command... (see here: https://github.com/conda/conda/pull/7457), so we need to do some magic found elsewhere on SO:
(base) C:\>dir %CONDA_PREFIX%\conda-meta\portaudio*
(...)
26.01.2020 13:17 5 577 portaudio-19.6.0-hfa6e2cd_3.json
We need to check this JSON and find the files property:
"extracted_package_dir": "C:\\Users\\(...)\\Anaconda3\\pkgs\\portaudio-19.6.0-hfa6e2cd_3",
"features": "",
"files": [
"Library/bin/portaudio.dll",
"Library/include/pa_asio.h",
"Library/include/pa_jack.h",
"Library/include/pa_linux_alsa.h",
"Library/include/pa_mac_core.h",
"Library/include/pa_win_ds.h",
"Library/include/pa_win_wasapi.h",
"Library/include/pa_win_waveformat.h",
"Library/include/pa_win_wdmks.h",
"Library/include/pa_win_wmme.h",
"Library/include/portaudio.h",
"Library/lib/portaudio.lib",
"Library/lib/portaudio_static.lib",
".nonadmin"
],
The extracted_package_dir (username removed above) actually amounts to:
%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3.
So, for this specific build, the necessary include directories (-I) are:
%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\include
And link directories (-L) are:
%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\lib
This will be useful below.
Simple way, which doesn't work
Now if your Conda environment has MSVC 14.0 for building native extensions you should be fine with:
(base) C:\> pip install --global-option=build_ext --global-option="-I%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\include" --global-option="-L%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\lib" pyaudio
Now, it will find portaudio.h!
But alas, at the time of writing, this fails with a compile error. I still put this here, because maybe the incompatibility with MSVC will be fixed.
The hard, but successful, way
We need to hack the sources of PyAudio. This can be done like so:
(base) C:\>pip download pyaudio
This will download a file like PyAudio-0.2.11.tar.gz (version number may differ in the future). You need to unpack it, using tar. I have it in C:\Windows\system32 - maybe because of WSL. You can also use 7-zip to unpack it. Anyway:
(base) C:\>tar xf PyAudio-0.2.11.tar.gz
(... unpacked ...)
(base) C:\>cd PyAudio-0.2.11
(base) C:\PyAudio-0.2.11>
Now to get the same result as before, you need to pass the special arguments to setup.py (in a different way than it's done for pip, of course):
(base) C:\PyAudio-0.2.11>python setup.py build_ext --include-dirs="%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\include" --library-dirs="%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\lib" install
(compile errors: min macro redefinition, __typeof__ undefined)
Now, edit the file src\_portaudiomodule.c, and delete/comment out these lines (right at the top, line ~39):
#define min(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})
This trivial macro is the culprit. If you want to submit a fix to Mr Pham (http://people.csail.mit.edu/hubert/pyaudio/), don't delete it, but use something like
#ifndef _MSC_VER ... #endif.
Save the file and run this (again):
(base) C:\PyAudio-0.2.11>python setup.py build_ext --include-dirs="%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\include" --library-dirs="%CONDA_PREFIX%\pkgs\portaudio-19.6.0-hfa6e2cd_3\Library\lib" install
Everything should be fine now.
EDIT: TL;DR easy way
After checking once again, I saw pyaudio in https://repo.anaconda.com/pkgs/main/win-64. This means, if you're using Anaconda you can just do:
conda install pyaudio
I'm leaving the rest of this answer for educational purposes.
Related
I want to install a package from GitHub that uses Cython (https://github.com/mlysy/kalmantv). I cloned the package locally, and after trying to install it with pip install ., I'm getting the following error:
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Processing /Users/me/Downloads/kalmantv
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk
cwd: /Users/me/Downloads/kalmantv
Complete output (6 lines):
running egg_info
writing kalmantv.egg-info/PKG-INFO
writing dependency_links to kalmantv.egg-info/dependency_links.txt
writing requirements to kalmantv.egg-info/requires.txt
writing top-level names to kalmantv.egg-info/top_level.txt
error: package directory 'eigen-3.3.7' does not exist
----------------------------------------
WARNING: Discarding file:///Users/me/Downloads/kalmantv. Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
I tried adding --use-feature=in-tree-build from the deprecation warning but still got the error (without the initial warning).
I saw a number of suggestions such as using pip install --upgrade pip setuptools wheel, but nothing is doing the trick. I would guess that this has a simple fix but this stuff is a little over my head and I don't want to break anything else.
What do I need to do to safely correct this issue without causing other problems?
The setup.py file has the following lines:
# path to eigen library
EIGEN_PATH = r"eigen-3.3.7"
Strangely, it seems to expect the Eigen header library to be present at that location. You can install the library with brew install eigen, or sudo apt install libeigen3-dev. Note that this may not install version 3.3.7 of the library, which the project expects. I don't know if using a newer version would cause any issues.
If you want to install version 3.3.7, you can build and install it from source with the following link by following these instructions:
https://gitlab.com/libeigen/eigen/-/releases/3.3.7
Once that's done, change to the project directory, and create a symlink to the Eigen library:
If installed with brew: ln -s /usr/local/Cellar/eigen/*/include/eigen3 eigen-3.3.7
If installed with apt: ln -s /usr/include/eigen3 eigen-3.3.7
If installed from source: /usr/local/include/eigen3 eigen-3.3.7
Once the Eigen library has been installed and made available at ./eigen-3.3.7, pip install . should work, but for good measures you should run the following command first:
pip install -U pip setuptools wheel; pip install -U cython
Refer to Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace if you run into an error like: error: no member named 'signbit' in the global namespace.
I am new to Python and try to install Jupyter Notebook from within a Windows command prompt window using:
pip install jupyter
But after a couple of minutes of downloading, an error message is displayed as shown below:
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\asd\appdata\local\programs\python\python38-32\python.exe
' 'c:\users\asd\appdata\local\programs\python\python38-32\lib\site-packages\pip\
_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\asd\Ap
pData\Local\Temp\tmpnj_hhq6y'
cwd: C:\Users\asd\AppData\Local\Temp\pip-install-_pnki5r8\pywinpty
Complete output (6 lines):
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\asd\appdata\local\progr
ams\python\python38-32\python.exe' 'c:\users\asd\appdata\local\programs\python\p
ython38-32\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata
_for_build_wheel 'C:\Users\asd\AppData\Local\Temp\tmpnj_hhq6y' Check the logs for
full command output.
WARNING: You are using pip version 20.2.1; however, version 21.1 is available.
You should consider upgrading via the 'c:\users\asd\appdata\local\programs\pytho
n\python38-32\python.exe -m pip install --upgrade pip' command.
I have attached here just the last part of the error output.
How to fix this error for a successful installation of Jupyter Notebook?
EDIT1: I installed the Rust package from the link in the error message. After that I tried installing Jupyter Notebook once again, and this time after proceeding a few steps further than before, it output another error:
Building wheels for collected packages: pywinpty
Building wheel for pywinpty (PEP 517) ... - WARNING: Subprocess output does
not appear to be encoded as cp1252
WARNING: Subprocess output does not appear to be encoded as cp1252
error
ERROR: Command errored out with exit status 1:
command: 'c:\users\asd\appdata\local\programs\python\python38-32\python.exe'
'c:\users\asd\appdata\local\programs\python\python38-32\lib\site-packages\pip\_v
endor\pep517\_in_process.py' build_wheel 'C:\Users\asd\AppData\Local\Temp\tmpaj5
u66_y'
cwd: C:\Users\asd\AppData\Local\Temp\pip-install-mep4ye8d\pywinpty
Complete output (60 lines):
Running `maturin pep517 build-wheel -i c:\users\asd\appdata\local\programs\pyt
hon\python38-32\python.exe`
Compiling proc-macro2 v1.0.26
Compiling unicode-xid v0.2.2
Compiling syn v1.0.71
Compiling winapi v0.3.9
Compiling jobserver v0.1.22
error: could not compile `proc-macro2`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
dY'¥ maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `cargo rustc --messag
e-format json --manifest-path Cargo.toml --release --lib --`
dY\x8d1 Building a mixed python/rust project
dY"- Found pyo3 bindings
dY\x90\x8d Found CPython 3.8 at c:\users\asd\appdata\local\programs\python\pyt
hon38-32\python.exe
error: linker `link.exe` not found
|
= note: The system cannot find the file specified. (os error 2)
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed wi
th the Visual C++ option
error: aborting due to previous error
error: linker `link.exe` not found
|
= note: The system cannot find the file specified. (os error 2)
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed wi
th the Visual C++ option
error: aborting due to previous error
error: linker `link.exe` not found
|
= note: The system cannot find the file specified. (os error 2)
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed wi
th the Visual C++ option
error: aborting due to previous error
Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'c:\\users\\asd\\app
data\\local\\programs\\python\\python38-32\\python.exe'] returned non-zero exit
status 1
----------------------------------------
ERROR: Failed building wheel for pywinpty
Failed to build pywinpty
ERROR: Could not build wheels for pywinpty which use PEP 517 and cannot be insta
lled directly
WARNING: You are using pip version 20.2.1; however, version 21.1 is available.
You should consider upgrading via the 'c:\users\asd\appdata\local\programs\pytho
n\python38-32\python.exe -m pip install --upgrade pip' command.
Upgrade your pip first:
pip install --upgrade pip
Then:
pip install jupyter
I'reached this post after failing to install notebook on a 32-bit python 3.8.3 execution. And as far as I found, pywinpty, which is a dependence, does not support 32-bit executions (see sources below).
I solved the problem by installing python on its 64-bit version.
Sources:
How do I determine if my python shell is executing in 32bit or 64bit?
pip install fails on Python 3.8 32-bit, prevents Jupyter install #129 which simply says that wheels cannot be installed with 32 bit Python and that you should use 64 bit Python instead.
We can't generate 32 bit wheels, sorry. Please use a 64bit build of Python.. Was not my case but might be useful this similar issue when using python 3.8 64-bit
Error installing Jupyter & pywinpty (Python)
https://github.com/spyder-ide/pywinpty/issues/123
Do
pip install wheel
and try again. It worked for me.
What to do:
Check if your python is 64-bit version. If no, go to python site (for example, here is the link to download 3.7.9. Just click at the version that has label "for AMD64/EM64T/x64", do it with any version you wish, just I don't like to use the newest version). Remove yours (with the uninstall file) and download this. Don't forget to put the checkmark near "Add PATH" below;
Download Rust (the description is inside) - you need some files. Check the PATHs - if you want to change them, do it (the names of the variables and where they are - both are written, you can search in the Internet how to change PATH var's (for example));
Go to Windows Shell with admin mode (Win+X and you get the field) - here is the most comfortable place to work;
Go to your python.exe (for example, my way is C:\Users\user\AppData\Local\Programs\Python\Python37) - just for sure;
python.exe python -m pip install --upgrade pip;
python.exe pip install jupyter;
If an error was returned that contains the missing of wheel, try to download it: python.exe pip install wheel.
Donwload any library you miss during installation and continue since the step you stopped at.
Try using Anaconda. link to install conda https://www.anaconda.com/products/individual
then cmd : conda install numpy
cmd: conda install jupyter
cmd : jupyter notebook
The error message looks quite clear, you needs to install Cargo via https://rustup.rs/
I have faced the same issue when I'm using vscode. The simplest solution is to use conda instead of pip
conda install jupyterlab
When I install a package with pip install -t some_dir, I can usually then add some_dir to my PYTHONPATH when running python and import the package. Like this:
~/dev/scratch [venv] » pip install -t some_dir pytest
...
Successfully installed py pytest
~/dev/scratch [venv] » PYTHONPATH=some_dir python
...
>>> import pytest
>>>
However, I recently added the library "stompest" to my dependencies, which is apparently a "namespace package" (not entirely sure what that means). It doesn't seem to work with this same pattern:
~/dev/scratch [venv] » pip install -t some_dir stompest
...
Successfully installed stompest
~/dev/scratch [venv] » PYTHONPATH=some_dir python
...
>>> import stompest.config
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named stompest.config
It works fine if I just install stompest normally (into a virtual environment, say):
~/dev/scratch [venv] » pip install stompest
...
Successfully installed stompest-2.1.6
~/dev/scratch [venv] » python
...
>>> import stompest.config
>>>
The problem seems to be that pip(?) lays down a .pth file that expects to be in the site-dir (notice f_locals['sitedir'] below):
~/dev/scratch [venv] » cat some_dir/stompest-2.1.6-py2.7-nspkg.pth
import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('stompest',)); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault('stompest',types.ModuleType('stompest')); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p)
I tried also setting PYTHONUSERBASE=some_dir, but that didn't seem to make any difference. It seems like a similar issue to this one, which suggests using --egg as a workaround. I can't get --egg to work with -t, though, because I get an error that I am "attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from." The problem is that I can't add the directory to PYTHONPATH because it seems to be trying to install to a temporary directory:
~/dev/scratch [venv] » PYTHONPATH=some_dir pip install -t some_dir --egg stompest
Collecting stompest
Using cached stompest-2.1.6.tar.gz
Installing collected packages: stompest
Running setup.py install for stompest
Complete output from command /home/nalderso/dev/scratch/venv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wc3oaO/stompest/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fZlXM2-record/install-record.txt --compile --install-headers /home/nalderso/dev/scratch/venv/include/site/python2.7/stompest --home=/tmp/tmpHNVOP0:
running install
Checking .pth file support in /tmp/tmpHNVOP0/lib/python/
/home/nalderso/dev/scratch/venv/bin/python -E -c pass
TEST FAILED: /tmp/tmpHNVOP0/lib/python/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/tmp/tmpHNVOP0/lib/python/
and your PYTHONPATH environment variable currently contains:
'some_dir'
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
----------------------------------------
Command "/home/nalderso/dev/scratch/venv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wc3oaO/stompest/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-fZlXM2-record/install-record.txt --compile --install-headers /home/nalderso/dev/scratch/venv/include/site/python2.7/stompest --home=/tmp/tmpHNVOP0" failed with error code 1 in /tmp/pip-build-Wc3oaO/stompest
Am I doing something wrong, or is this an issue with pip?
It works when you do this:
import site
site.addsitedir('some_dir')
See https://docs.python.org/2/library/site.html#site.addsitedir
I found this answer in a post by Matt Iversen (Ivoz) in this pip issue. Note that talk in this issue continues about some corner cases you might run into.
I am trying to install fatiando, a geophysical modelling package for Python.
I have a Mac with OS X v10.9.5. I am getting all the dependencies for Fatiando (via Anaconda) by following the recommended installation suggested on the package site. I have Xcode installed.
I get a list of warnings and a final error message:
fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "//anaconda/bin/python -c "import setuptools, tokenize;__file__='/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-QFjo6d-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-CY4vyX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-QFjo6d-build
Macintosh-5:fatiando matteoniccoli$
The full Terminal output (1100+ lines) can be found here.
I already contacted the developers, this does not seem to be a Fatiando issue.
Any suggestions?
UPDATE, March 15
When I first posted this I did not have Xcode, then I downloaded the latest Xcode from Apple store. Tried again, got the same message. Then I read this and downloaded gcc from here, and installed directly. When I type on terminal: gcc --version, I get this: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
After that, though, I still get similar messages. Following another stackoverflow lead, I tried to install setuptools from here
using curl https://bootstrap.pypa.io/ez_setup.py -o - | python
Now I get a different error (at the end again of a long output) when I try to install fatiando:
fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "//anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-build-m1ieVO/fatiando/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-9wI6Z7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/32/mwq0jhwd3dx7vjqmm8hkljp80000gn/T/pip-build-m1ieVO/fatiando
Someone from a forum asked me by email:
Re Fatiando, did you install Xcode command line tools? Eg see this
http://railsapps.github.io/xcode-command-line-tools.html
But when I try to verify tI’ve successfully installed Xcode Command Line Tools as suggested there, I get this, so I assume it was not the issue:
-bash: /Library/Developer/CommandLineTools: is a directory
UPDATE MARCH 16
Tried solution suggested by Leo Uieda.
pip install --upgrade https://github.com/fatiando/fatiando/archive/kill-omp.zip went without a problem, but
pip install --upgrade https://github.com/fatiando/fatiando/archive/master.zip gets me back at square 1:
...
...
fatiando/gravmag/_polyprism.c:349:10: fatal error: 'omp.h' file not found
#include "omp.h"
^
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Rolling back uninstall of fatiando
This is a very common problem with the Fatiando install, specially on Windows and Mac. OpenMP was introduced in PR 106 for the fatiando.gravmag forward modeling modules. It was easy to implement (just replace a range(ndata) with a prange(ndata)) and was resulting in 1.5-2x speedup over sequential execution. Also, the parallel execution was automatic. So it seemed like a good trade-off at the time ("Just install an extra dependency? What could go wrong?").
The problems began when the Anaconda gcc and the default Mac gcc didn't come with OpenMP. So Windows users had to install an extra dependency (in a very specific order, like a satanic ritual) and Mac users had to fend for themselves.
OpenMP and compiled Cython modules are being removed from Fatiando (#169) in preference of multiprocessing and numba. This would make it a pure Python package (no compilation necessary) and most of the install issues should be resolved.
In the mean time, PR 177 removes the OpenMP requirement from the Cython modules. This should fix your current install problems. To get the changes right away, you can install the version from the kill-omp branch by running:
pip install --upgrade https://github.com/fatiando/fatiando/archive/kill-omp.zip
If the above command doesn't work, it means that the pull request has been merged into the main branch of the project (master). If that's the case, you can install the latest version from the master branch:
pip install --upgrade https://github.com/fatiando/fatiando/archive/master.zip
These changes will be included in the future v0.4 release. Hope this fixes your problem.
(It would be useful to know which version of gcc you are using.)
gcc did not ship with OpenMP prior to v4.9.
See this answer could help you update gcc it using xcode.
I got that issue when i try installing pylint on windows with pip, and i really have no idea from where it comes from.
C:\Python33\Scripts>pip.exe install pylint
Downloading/unpacking pylint
Getting page https://pypi.python.org/simple/pylint/
URLs to search for versions for pylint:
* https://pypi.python.org/simple/pylint/
Analyzing links from page https://pypi.python.org/simple/pylint/
...
byte-compiling C:\Python33\Lib\site-packages\pylint\utils.py to utils.cpython-33.pyc
byte-compiling C:\Python33\Lib\site-packages\pylint\__init__.py to __init__.cpython-33.pyc
byte-compiling C:\Python33\Lib\site-packages\pylint\__pkginfo__.py to __pkginfo__.cpython-33.pyc
error: The system cannot find the file specified
running 2to3 on C:\Python33\Lib\site-packages\pylint\test
----------------------------------------
Cleaning up...
Removing temporary dir c:\windows\temp\pip_build_abrow198...
Command C:\Python33\python.exe -c "import setuptools;__file__='c:\\windows\\temp\\pip_build_abrow198\\pylint\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\windows\temp\pip-cq0pam-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\windows\temp\pip_build_abrow198\pylint
Looks like there's an error in the setup scripts for both Pylint and its dependency logilab-common. I encounter the error when building with pip install pylint or python setup.py install.
The error generally looks like this, and occurs right after .pyc files are byte-compiled:
error: The system cannot find the file specified
running 2to3 on C:\Python33\Lib\site-packages\pylint\test
Simply making sure that 2to3.py is available on PATH doesn't seem to be sufficient; 2to3 itself will run, but Pylint won't install.
I just spent a bit trying to get this working, and found two promising suggestions:
First option, create a custom bat file so that 2to3 is effectively on your PATH (see SO thread, issue tracker). I managed to get 2to3 running as a bare command in both PowerShell and CMD, but couldn't get Pylint to install. Someone else might have more luck with this.
Second option, install different versions of Pylint and logilab-common which invoke 2to3 through distutils instead of on the command line (see unmerged pull request). This worked immediately for me.
BitBucket lists that pull request as "open" since October. I don't know when it might be merged, or how long after that changes might be live on PyPI.