OS X Pillow installation error - python

I followed this instructions: http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation
$ sudo pip install Pillow
returned error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bAG3wP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Pillow
Storing debug log for failure in /var/root/Library/Logs/pip.log
in pip.log:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bAG3wP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Pillow
Please, help me!
UPDATE:
I installed PIL before. After installation I tried some black magic to make PIL work with libjpeg. And then I tried to reinstall PIL. It was uninstalled, but failed to install.

There seems to be something broken when running XCode 5.1. Had the same problem when installing pycrypto.
Try this:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install Pillow

Related

Unable to get Python "ibm_db" module using pip install

I am trying to install ibm_db module for python using pip install but getting below error.
" C:\Users\n087514>pip install ibm_db Collecting ibm-db Using cached
https://repo-man.aetna.com/nexus/repository/ae-pypi-group/packages/f8/6f/5f8186cb31021409235a948be5e29d77761ef92747a101360003747c4105/ibm_db-2.0.8.tar.gz
Installing collected packages: ibm-db Running setup.py install for
ibm-db ... error
Complete output from command "c:\program files (x86)\python 3.5\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\n087514\AppData\Local\Temp\pip-g_xrj1vq-record\install-record.txt
--single-version-externally-managed --compile:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py",
line 17, in
os.rename('tests','test_2')
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'tests' -> 'test_2'
---------------------------------------- Command ""c:\program files (x86)\python 3.5\python.exe" -u -c "import setuptools,
tokenize;file='C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\n087514\AppData\Local\Temp\pip-g_xrj1vq-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\n087514\AppData\Local\Temp\pip-build-_w1_snzp\ibm-db\"
Anyone has any idea what needs to be done?
Thanks in advance!
Try:
pip install "ibm_db==2.0.8a"

Why can I not install pyenv?

Problem:
I am using python 2.7 on my Windows 10 computer.
When I run
pip install pyenv
I get the error shown below.
This is the only pip module that I have run into that I cannot install successfully. I'm not sure why this happens. Any ideas?
Error Message:
pip install pyenv
Collecting pyenv
Downloading pyenv-20150113.1.tar.gz
Building wheels for collected packages: pyenv
Running setup.py bdist_wheel for pyenv: started
Running setup.py bdist_wheel for pyenv: finished with status 'error'
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\u sers\\user\\appdata\\local\\temp\\pip-build-_6j2tq\\pyenv\\setup.py';f=getattr(tokenize, 'open', open )(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_w heel -d c:\users\user\appdata\local\temp\tmprb9n7epip-wheel- --python-tag cp27:
running bdist_wheel
running build
installing to build\bdist.win32\wheel
running install
Cloning into 'C:/Users/user/.pyenv'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-doctor'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-installer'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-pip-rehash'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-update'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-virtualenv'...
Cloning into 'C:/Users/user/.pyenv/plugins/pyenv-which-ext'...
WARNING: seems you still have not added 'pyenv' to the load path.
# Load pyenv automatically by adding
# the following to your profile:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\user\appdata\local\temp\pip-build-_6j2tq\pyenv\setup.py", line 33, in <module>
cmdclass=dict(install=PyenvInstall),
File "c:\python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\site-packages\wheel\bdist_wheel.py", line 257, in run
self.distinfo_dir)
File "c:\python27\lib\site-packages\wheel\bdist_wheel.py", line 393, in egg2dist
raise ValueError(err)
ValueError: Egg metadata expected at build\bdist.win32\wheel\.\pyenv-20150113.1-py2.7.egg-info but not found
----------------------------------------
Failed building wheel for pyenv
Running setup.py clean for pyenv
Failed to build pyenv
Installing collected packages: pyenv
Running setup.py install for pyenv: started
Running setup.py install for pyenv: finished with status 'error'
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\ \users\\user\\appdata\\local\\temp\\pip-build-_6j2tq\\pyenv\\setup.py';f=getattr(tokenize, 'open', op en)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" insta ll --record c:\users\user\appdata\local\temp\pip-wjwco5-record\install-record.txt --single-version-ex ternally-managed --compile:
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 --single-version-externally-managed not recognized
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata \\local\\temp\\pip-build-_6j2tq\\pyenv\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.rea d().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\mse dmon\appdata\local\temp\pip-wjwco5-record\install-record.txt --single-version-externally-managed --compi le" failed with error code 1 in c:\users\user\appdata\local\temp\pip-build-_6j2tq\pyenv\
The "pypi" page of pyvenv mentions:
The PyPi support is not tested by many users yet, so the direct way
ist still recommended if you want to play it safe.
The authors of the package recommend to use their dedicated installation script.

Unable to download a package using Pip : says Cython not installed when it is

I am trying to download the pyahocorasick package on my Windows 10 system using pip.
On my command line, I wrote-
pip install pyahocorasick
It gave the following output -
Collecting pyahocorasick
Using cached pyahocorasick-1.1.4.tar.bz2
Installing collected packages: pyahocorasick
Running setup.py install for pyahocorasick ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\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\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
failed to import Cython: DLL load failed: %1 is not a valid Win32 application.
error: Cython does not appear to be installed
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Krishna\\AppData\\Local\\Temp\\pip-build-b7a1mq0t\\pyahocorasick\\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\Krishna\AppData\Local\Temp\pip-3iv3a5oc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Krishna\AppData\Local\Temp\pip-build-b7a1mq0t\pyahocorasick\
Then I tried to see if Cython is in fact installed, so I wrote-
Cython version
and the output was -
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\cython.exe\__main__.py", line 5, in <module>
File "C:\Python34\lib\site-packages\Cython\Compiler\Main.py", line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: %1 is not a valid Win32 application.
And finally I tried -
install Cython
And the output was -
Requirement already satisfied: Cython in c:\python34\lib\site-packages
So my question is - if Cython is already installed, why does installing the package pyahocorasick give the error - Cython does not appear to be installed? And how can I fix this problem?

Issues installing scipy using Python

I've tried pip install scipy. I've tried all the suggestions on stackOverflow like updating pip, installing scipy manually through its website. I've tried getting it from github directly.
These are some of the errors I keep getting:
-When I try pip install:
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\kathyz~1\\appdata\\local\\temp\\pip-build-gmb8oc\\scipy\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\kathyz~1\appdata\local\temp\pip-gndjc
d-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in c:\users\kathyz~1\appdata\local\temp\pip-build-gmb8oc\sci
py
-When I try through git:
Exception: Cython either isn't installed or it failed.
Cythonizing sources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 253, in <module>
setup_package()
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 246, in setup_package
generate_cython()
File "c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build\setup.py", lin
e 164, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\us
ers\\kathyz~1\\appdata\\local\\temp\\pip-49aa2n-build\\setup.py';exec(compile(ge
tattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record c:\users\kathyz~1\appdata\local\temp\pip-92weib-recor
d\install-record.txt --single-version-externally-managed --compile" failed with
error code 1 in c:\users\kathyz~1\appdata\local\temp\pip-49aa2n-build
So after getting error about cythonize, I tried installing it, which led to another error:
warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.h' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
error: Setup script exited with error: Unable to find vcvarsall.bat

Cannot install lxml 3.3.3 on OSX 10.9 with buildout

Have seen numerous related posts but not had any luck getting this to work. Log shows:
We have no distributions for lxml that satisfies 'lxml'.
Getting distribution for 'lxml'.
Running easy_install:
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" "-c" "from setuptools.command.easy_install import main; main()" "-mZUNxd" "/Users/brad/Development/python/eggs/tmpLpoVC3" "-q" "/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/tmpZx0t7aget_dist/lxml-3.3.3.tar.gz"
path=/Users/brad/Development/python/eggs/setuptools-0.7.2-py2.7.egg
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
In file included from src/lxml/lxml.etree.c:346:
/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/easy_install-XSC3pm/lxml-3.3.3/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1Building lxml version 3.3.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
An error occurred when trying to install lxml 3.3.3. Look above this message for any errors that were output by easy_install.
While:
Installing pydev.
Getting distribution for 'lxml'.
Error: Couldn't install: lxml 3.3.3
Tried answers from Cannot install Lxml on Mac os x 10.9.
xcode-select --install worked initially until an XCode upgrade to 10.5. Then hasn't worked since (even after retrying this line). Now I always get Can't install the software because it is not currently available from the Software Update server
Tried this STATIC_DEPS=true pip install lxml. It installed with error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Storing debug log for failure in /Users/brad/Library/Logs/pip.log
That log file ends with:
Cleaning up...
Removing temporary dir /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Creating the symlink (https://stackoverflow.com/a/19549645/1399659) didn't help either.
Ideas appreciated, thanks
Ok, so coming back to this with fresh eyes, again, managed to resolve it.
The error clang: error: unknown argument: '-mno-fused-madd' during the pip install lxml above was the clincher. I'd spotted it and https://stackoverflow.com/a/22578811/1399659, but couldn't get another python version to work. Had tried MacPorts and Homebrew.
Finally a tip from https://stackoverflow.com/a/17439319/1399659 led me to removing macport's lxml and the system-installed pip. Then installing HomeBrew's python over fresh (with occasional forced linking), let me use it's installed pip to run bog-standard pip install lxml
Now running Homebrew's python 2.7.6 and pip, which was used to install lxml 3.3.3

Categories