I'm trying to upgrade Pillow on my Mac. When I run sudo pip install Pillow I get
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./lib/python2.7/site-packages/Pillow-2.3.0-py2.7-macosx-10.8-intel.egg
I run sudo pip install --upgrade Pillow and I get the following error:
copying PIL/OleFileIO-README.md -> build/lib.macosx-10.9-intel-2.7/PIL
running build_ext
--- using frameworks at /System/Library/Frameworks
building 'PIL._imaging' extension
creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/libImaging
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/opt/local/include/freetype2 -I/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/build/Pillow/libImaging -I/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o
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
----------------------------------------
Rolling back uninstall of Pillow
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/lib/python2.7/site-packages/pip/req.py", line 1439, in install
requirement.rollback_uninstall()
File "/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/lib/python2.7/site-packages/pip/req.py", line 603, in rollback_uninstall
self.uninstalled.rollback()
File "/Users/edwinzg/School/College/SeniorYear/SpringSemester/rb-master/lib/python2.7/site-packages/pip/req.py", line 1855, in rollback
pth.rollback()
AttributeError: 'str' object has no attribute 'rollback'
Does anyone know how to fix this? Thanks.
This worked for me:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade pillow
Related
This is in continuation with my earlier question Geospatial Analytics in Python
I started a new question to keep the 2 issues logically separate.
I have trying to install geopandas on python 2.6
surprisingly, geopandas is already installed by GeoSeries doesn't work and it needs a package "Fiona". I followed the instruction provided here
I installed the libraries required by searching and following the suggestions (including dev libraries thinking I'll get the .h files), I am however stuck with these two issues:
https://github.com/Toblerity/Fiona
after cloning from git and python setup.py install on Fiona, I get the error:
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c fiona/_geometry.c -o build/temp.linux-x86_64-2.6/fiona/_geometry.o
gcc: fiona/_geometry.c: No such file or directory
pip install geopandas gives
fiona/_transform.cpp:269:18: error: gdal.h: No such file or directory
fiona/_transform.cpp:270:26: error: gdal_version.h: No such file or directory
fiona/_transform.cpp:271:22: error: cpl_conv.h: No such file or directory
fiona/_transform.cpp:272:24: error: cpl_string.h: No such file or directory
fiona/_transform.cpp:273:21: error: cpl_vsi.h: No such file or directory
fiona/_transform.cpp:274:22: error: ogr_core.h: No such file or directory
Any help with sorting the issues and getting geopandas installed will be greatly appreciated
On Linux Mint, Python 2.7.10 (Anaconda):
sudo apt-get install libgeos-dev
sudo apt-get install libgdal-dev
pip install geopandas
Successfully installed descartes-1.0.1 fiona-1.6.2 geopandas-0.1.1 pyproj-1.9.4
I would recommend moving to 2.7.10. The two development libraries were all that I needed on my system. It seems that you are likely missing libgdal-dev.
I'm struggling to install the mysql-python pip either systemwide or in a venv on Ubuntu 14.04 with MariaDB 10 installed. Also tried with MariaDB 5.5 and getting the same error. I don't have this issue with vanilla mysql-server installed.
I have the following installed via apt-get:
build-essential
python-dev
libmariadbclient-dev (thats the MariaDB replacement for libmysqlclient-dev)
python-mysqldb
Originally I thought this was an issue installing this into a venv but I've subsequently noticed mysql-python won't install systemwide either. Below are the cmds I used to install in a venv.
virtualenv venv
. venv/bin/activate
pip install mysql-python==1.2.5
In file included from _mysql.c:44:0:
/usr/include/mysql/my_config.h:439:0: warning: "HAVE_WCSCOLL" redefined [enabled by default]
#define HAVE_WCSCOLL
^
In file included from /usr/include/python2.7/pyconfig.h:3:0,
from /usr/include/python2.7/Python.h:8,
from _mysql.c:29:
/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h:911:0: note: this is the location of the previous definition
#define HAVE_WCSCOLL 1
^x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmariadbclient_r -lpthread -lz -lm -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/_mysql.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /root/env/bin/python -c "import setuptools, tokenize;__file__='/root/env/build/mysql- python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EyhO2v-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/env/include/site/python2.7 failed with error code 1 in /root/env/build/mysql-python
Storing debug log for failure in /root/.pip/pip.log
You need to have installed the development libraries of OpenSSL. It can be a libssl-dev, libssl-devel if your distribution provides separated packages for the dev libraries. Or install the complete openssl package if they don't.
(venv)➜ src pip install mysql-python==1.2.5
Downloading/unpacking mysql-python==1.2.5
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/home/braiam/src/venv/build/mysql-python/setup.py) egg_info for package mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
building '_mysql' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing
In file included from _mysql.c:44:0:
/usr/include/mysql/my_config.h:439:0: warning: "HAVE_WCSCOLL" redefined
#define HAVE_WCSCOLL
^
In file included from /usr/include/python2.7/pyconfig.h:3:0,
from /usr/include/python2.7/Python.h:8,
from _mysql.c:29:
/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h:911:0: note: this is the location of the previous definition
#define HAVE_WCSCOLL 1
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmariadbclient_r -lpthread -lz -lm -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/_mysql.so
Successfully installed mysql-python
Cleaning up...
But, there were two messages that you have that I didn't, namely:
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
Which if you did ld -lcrypto --verbose or ld -lssl --verbose wouldn't produce this results:
➜ src ld -lcrypto --verbose | grep succeeded
attempt to open //usr/lib/x86_64-linux-gnu/libcrypto.so succeeded
ld: warning: cannot find entry symbol _start; not setting start address
➜ src ld -lssl --verbose | grep succeeded
attempt to open //usr/lib/x86_64-linux-gnu/libssl.so succeeded
ld: warning: cannot find entry symbol _start; not setting start address
So, to fix this just make sure you have installed the libssl-dev package which provides both libraries.
I meet the similar error on MacOS but there is no "/usr/bin/ld: cannot find -lssl" for me.
Solved with the following steps:
Step 1. Make sure you have installed openssl with homebrew.
brew install openssl
Step 2. In a terminal:
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
For Linux you can also try yum install your missing library and add them to LIBRARY_PATH.
For Debian 9.x:
apt install libssl-dev
For CentOS:
sudo yum install openssl-devel
I've run into an error while installing Kivy, which told me to install Cython, so I did.
Except I run into an error, I've tried installing with pip,easy_install, manually but it results in the same. I also tried installing a older version of Cython but no luck.
Error message:
Command /usr/bin/python -c "import setuptools, tokenize;file='/private/tmp/pip_build_root/Cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-nXMqSR-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/Cython
Storing debug log for failure in /Users/jorn/Library/Logs/pip.log
When I install manually I get this error:
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Cython/Plex/Scanners.c -o build/temp.macosx-10.8-intel-2.7/Cython/Plex/Scanners.o
unable to execute clang: No such file or directory
error: command 'clang' failed with exit status 1
I have read and tried all solutions I could find but none work..
I'm running on Mac osx 10.8.5
Ok, thanks to what #RaynP just said about it being a osx/clang issue I found the solution:
credits to this blog: http://kaspermunck.github.io/2014/03/fixing-clang-error/
The error is related to Xcode 5.1.
You will have to download the cython-master from GitHub. Installing with pip will not work and results in another error.
in terminal go to the cython-master file and enter: sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future python setup.py install
This is a workaround the error.
Now I have installed Cython and can finally compile my app with Kivy/Buildozer:D
When I execute
sudo pip install pandas
I get the error:
creating build/temp.macosx-10.9-intel-2.7/pandas/src/datetime
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Ipandas/src/klib -Ipandas/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.9-intel-2.7/pandas/index.o
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
I have installed xcode and xcode command line tools.
In fact, I can confirm that cc is installed by executing:
cc -v
which returns:
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
These flags ended up letting me install it:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
and then (of course):
sudo -E pip install pandas
Thanks #user3378649 for the flags suggestion - that got me thinking along the right track!
Can you please these commands for more information.
As long as you didn't mention what you used to overcome this problem, I'd suggest different approaches to help narrow down in order to find the problem:
First Solution :
Run these flags :
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
if it doesn't work
run these flags :
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Second Solution :
Get Homebrew - it's a one-line shell script to install!
Edit your .profile, or whatever is appropriate, and put /usr/local/bin at the start of -your PATH so that Homebrew binaries are found before system binaries
brew install python - this installs a newer version of python in /usr/local
run "pip install pandas"
Third Solution :
use easy_install.
Execute the following command in Terminal
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$(PATH)}"
export PATH
Then :
$ sudo easy_install pandas
I run sudo gem install localtunnel and I get the following output. Now I am used homebrew to instal rbenv to install ruby and when i run brew doctor it says xcode is out of date but when i open up xcode and go to about it is the newest version, here is my error output for sudo gem install localtunnel
ERROR: Error installing localtunnel:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DJSON_GENERATOR -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -O3 -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c generator.c
xcrun: Error: could not stat active Xcode path '/Developer'. (No such file or directory)
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o generator.bundle generator.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lpthread -ldl -lobjc
i686-apple-darwin11-llvm-gcc-4.2: generator.o: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: generator.o: No such file or directory
lipo: can't figure out the architecture type of: /var/tmp//ccfplODR.out
make: *** [generator.bundle] Error 1
Xcode 4 is not installed in /Developer anymore, but xcrun seems to expect it there.
I would install the "Command Line Tools" first (Xcode preferences -> Downloads -> Components).
If that does not help, call
sudo xcode-select -switch /Applications/Xcode.app
to explicitly set the path for xcrun.
My Ruby Version was out of date, I had to run rbenv install 1.9.3-p0 and than set it to the global.