I've been trying to install Pygame for days now, and the only dependency missing is smpeg. I get the following output:
brew install --HEAD smpeg
==> Installing dependencies for smpeg: gobject-introspection, gdk-pixbuf,
==> Installing smpeg dependency: gobject-introspection
==> Building source; bottle blocked by python requirement
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.4
Already downloaded: /Library/Caches/Homebrew/gobject-introspection-1.40.0.tar.xz
==> ./configure --prefix=/usr/local/Cellar/gobject-introspection/1.40.0
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/sitepackages
checking for headers required to compile python extensions... ./configure: line 14647: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/pytho n-config: No such file or directory
not found
configure: error: Python headers not found
I've also tried to brew edit smpeg, adding include.install Dir["*.h"] above the two end at the end of the code, but to no avail.
My brew doctor says:
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.
My brew list says:
autoconf git libgcrypt mpfr sdl_mixer
automake glib libgpg-error pkg-config sdl_ttf
cloog gmp libmpc portmidi tree
cmake gnu-getopt libpng pwgen webp
freetype isl libtiff sdl xz
gettext jpeg libtool sdl_gfx
gfortran libffi mercurial sdl_image
brew --config:
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 7448fd1532ae1c1709fe2f03ffe0dc188a134b3e
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
X11: 2.7.5 => /opt/X11
brew was updated and upgraded
I have Python 2.7.6
Later I've managed to install smpeg.h (and MPEGfilter.h) in Python.framework/Versions/2.7/include/python and now when I run python setup.py install from cd pygame-1.9.1release, I get:
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/movie.c -o build/temp.macosx-10.3-fat-2.7/src/movie.o
In file included from src/movie.c:26:
In file included from src/pygame.h:106:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_main.h:26:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_stdinc.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config.h:34:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config_macosx.h:29:
/usr/include/AvailabilityMacros.h:110:14: warning: Building for Intel with Mac
OS X Deployment Target < 10.4 is invalid. [-W#warnings]
#warning Building for Intel with Mac OS X Deployment Target ...
^
1 warning generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat-2.7/src/movie.o -ls -lm -lp -le -lg -o build/lib.macosx-10.3-fat-2.7/pygame/movie.so -framework SDL -F/Library/Frameworks/
ld: library not found for -ls
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
got it. did this: inside 'pygame-1.9.1release', 'cd src, emacs scale_mmx64.c'. there I looked for all occurrences of 'movsxl' and replaced them (two) with with 'movslq'. then 'sudo pip install hg+http://bitbucket.org/pygame/pygame worked'.
Related
I want to install the python library scikit-bio via pip using following command:
sudo pip install scikit-bio
on my system:
uname -a
Linux grassgis 3.2.0-69-generic-pae #103-Ubuntu SMP Tue Sep 2 05:15:53 UTC 2014 i686 i686 i386 GNU/Linux
However this causes an error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c skbio/alignment/_ssw/_ssw_wrapper.c -o build/temp.linux-i686-2.7/skbio/alignment/_ssw/_ssw_wrapper.o
In file included from skbio/alignment/_ssw/ssw.h:17:0,
from skbio/alignment/_ssw/_ssw_wrapper.c:355:
/usr/lib/gcc/i686-linux-gnu/4.6/include/emmintrin.h:32:3: error: #error "SSE2 instruction set not enabled"
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1532:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__ufunc_api.h:226:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1
I ran already sudo apt-get update and sudo apt-get upgrade to get the most recent versions of installed software.
My GCC version is:
gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
How can I successfully install the scikit-bio packages for python?
This problem was previously reported by a user with an i686 machine on the scikit-bio issue tracker. The error occurs while compiling SSW, an external C program that is shipped with scikit-bio. The author of SSW recommended passing -msse2 to the compiler to fix the issue.
A fix was merged into the development branch of scikit-bio to include this flag for i686 machines.
If you are installing a release version of scikit-bio, you can specify this flag via CFLAGS on the command line:
CFLAGS=-msse2 pip install scikit-bio
or:
sudo CFLAGS=-msse2 pip install scikit-bio
Alternatively, scikit-bio's setup.py file can be modified to include '-msse2' in SSW's extra_compile_args.
Calling
pip install SQLAlchemy
I get an error:
lib/sqlalchemy/cextension/processors.c:10:20: fatal error: Python.h: No such file or directory
As far as I know, I have the correct Python version (2.7.3) and OS (Ubuntu 12.04) (See below.) for this to work. Am I doing anything wrong?
The install does work as
pip install --global-option='--without-cextensions' SQLAlchemy"
but I want the C extensions.
Full output:
root#mycomputer:/# pip install SQLAlchemy
Downloading/unpacking SQLAlchemy
Downloading SQLAlchemy-0.8.3.tar.gz (3.9Mb): 3.9Mb downloaded
Running setup.py egg_info for package SQLAlchemy
warning: no files found matching '*.jpg' under directory 'doc'
no previously-included directories found matching 'doc/build/output'
Installing collected packages: SQLAlchemy
Running setup.py install for SQLAlchemy
building 'sqlalchemy.cprocessors' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c lib/sqlalchemy/cextension/processors.c -o build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/processors.o
lib/sqlalchemy/cextension/processors.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
***************************************************************************
command 'gcc' failed with exit status 1
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
***************************************************************************
warning: no files found matching '*.jpg' under directory 'doc'
no previously-included directories found matching 'doc/build/output'
***************************************************************************
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python build succeeded.
***************************************************************************
Successfully installed SQLAlchemy
Cleaning up...
root#mycomputer:/#
Python Version:
root#mycomputer:/#python -V
Python 2.7.3
root#mycomputer:/#
Ubuntu Version:
root#mycomputer:/#cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
root#mycomputer:/#
You need to install the python-dev (or similar name) package for your version of Python. It includes all the header files needed to compile C extensions. These files are (unfortunately) not included in the default python packages.
For Ubuntu, the command is
sudo apt-get install python-dev
or
sudo apt-get install python3-dev
depending on which version you're using.
sudo apt-get install python-dev -y
I have XCode installed and also FreeTDS. I tried to connect to my SQL Server and it works perfect.
Now I have to develop an aplication on python that works with this SQL Server and I´m trying to install pymsql, but I got this error when I launche sudo python setup.py command:
==> sudo python setup.py install
running install
running bdist_egg
running egg_info
writing pymssql.egg-info/PKG-INFO
writing top-level names to pymssql.egg-info/top_level.txt
writing dependency_links to pymssql.egg-info/dependency_links.txt
reading manifest file 'pymssql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymssql.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-intel/egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
llvm-gcc-4.2 -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 -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/sw/include -Ifreetds/nix_64/include -I/opt/local/include -I/opt/local/include/freetds -I/opt/local/freetds/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mssql.c -o build/temp.macosx-10.7-intel-2.7/_mssql.o -DMSDBLIB
_mssql.c: In function ‘__pyx_f_6_mssql_15MSSQLConnection_convert_python_value’:
_mssql.c:7322: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c: In function ‘__pyx_f_6_mssql_15MSSQLConnection_get_result’:
_mssql.c:9554: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c:9566: warning: implicit conversion shortens 64-bit value into a 32-bit value
_mssql.c: In function ‘__pyx_pf_6_mssql_20MSSQLStoredProcedure_2bind’:
_mssql.c:11146: warning: implicit conversion shortens 64-bit value into a 32-bit value
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/_mssql.o -L/sw/lib -Lfreetds/nix_64/lib -L/opt/local/lib -L/opt/local/lib/freetds -L/opt/local/freetds/lib -lsybdb -lrt -o build/lib.macosx-10.7-intel-2.7/_mssql.so
ld: warning: directory not found for option '-L/sw/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib/freetds'
ld: warning: directory not found for option '-L/opt/local/freetds/lib'
ld: library not found for -lrt
collect2: ld returned 1 exit status
ld: warning: directory not found for option '-L/sw/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib/freetds'
ld: warning: directory not found for option '-L/opt/local/freetds/lib'
ld: library not found for -lrt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc6eQsIN.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Any help or clue?
Unfortunately, pymssql's setup.py (as of version pymssql-2.0.0b1-dev-20111019) needs a bit of help to work properly on OSX Lion. The current setup.py tries to compile/link against some pre-built Linux FreeTDS libraries, and also tries to link against librt, which doesn't exist on OSX. Additionally, it only explicitly looks for FreeTDS libraries from Fink or MacPorts, so if you've installed Homebrew (if you use if) or FreeTDS itself in a non-standard location, it may not be located by compiler/linker.
I created a repaired version of setup.py here. It worked well enough for me with the Homebrew build of FreeTDS using the standard locations (/usr/local/{lib, include}), but as always YMMV. You may need to adjust setup.py further if you've installed FreeTDS in a different location. You can generally ignore the warnings from the linker about missing directories that may not exist on your system:
ld: warning: directory not found for option '-L/usr/local/lib/freetds'
One other note: You will probably have built FreeTDS for a single architecture, likely x86_64. By default, pymssl will be a multi-architecture build (assuming you're using the system Python 2.7.1), so even with a patched setup.py you will see a linker warning something like:
ld: warning: ignoring file /usr/local/lib/libsybdb.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
That warning just indicates that the FreeTDS libraries only have single architecture version to link against. You can avoid the warning by using ARCHFLAGS to make a x86_64-only build:
ARCHFLAGS="-arch x86_64" python setup.py install
Or, try this fork, it installs without issues:
https://github.com/blackbass1988/pymssql-macos-lion
To install on OS X Mavericks, you need
OS X Command Line Tools
FreeTDS
brew install freetds
Cython
pip install cython
and then finally you can install the pymssql-macoslion
pip install git+git://github.com/blackbass1988/pymssql-macos-lion.git#master
Just incase anyone is reading this the following worked for me:
brew install freetds
sudo pip install pymssql
I installed ipython but it doesn't have the readline option. I first downloaded gnu readline and compiled and installed. DIdn't know whether it was a proper solution but was the first thing I thought of. It still wouldn't work to no avail with the same error as before:
WARNING: Readline services not available on this platform.
WARNING: The auto-indent feature requires the readline library
Then I tried using pip install readline and I get the error below. Any help would be appreciated:
running install
running build
running build_ext
building 'readline' extension
creating build
creating build/temp.linux-x86_64-2.6
creating build/temp.linux-x86_64-2.6/Modules
creating build/temp.linux-x86_64-2.6/Modules/2.x
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/home/jspender/include/python2.6 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.6/Modules/2.x/readline.o -Wno-strict-prototypes
creating build/lib.linux-x86_64-2.6
gcc -pthread -shared build/temp.linux-x86_64-2.6/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -L/home/jspender/lib -lncurses -lpython2.6 -o build/lib.linux-x86_64-2.6/readline.so
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /home/jspender/bin/python2.6 -c "import setuptools;__file__='/home/jspender/build/readline/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-lBWIOm-record/install-record.txt failed with error code 1
Storing complete log in /home/jspender/.pip/pip.log
tmaric is right. I had the same problem while installing iPython (Ubuntu 12.10, quantal, 32-bit). I was missing the dev version of the ncurses5 library. Try:
sudo apt-get install libncurses5-dev
and then installing the readline module again through pip
pip install readline
You have a linker error: library ncurses is not installed, or it is installed and the linker is searching for the wrong object file.
What platform/operating system are you using?
If you're running Linux/Unix, try:
locate libncurses
to see if the library is installed. If there are no libncurses*.{o,so,so.[0-9].[0-9]} files on your system, just install the library, and the readline. If there are some, then check which one is searched for by the readline compilation process, it could be that you just have to make a symbolic link, naming the library file properly.
I had the same issue with my Ubuntu 14.04 install trying to get some python libraries installed. iPython I believe requires readline which was failing for me until I ran the following commands.
sudo apt-get install python-dev
sudo apt-get install libncurses5-dev
sudo pip install readline
Trying to install Cython on a small VPS running Ubuntu Server. Did
sudo apt-get install gcc
and then
python setup.py install
In the Cython directory, but I get this peculiar error.
running install
running build
running build_py
running build_ext
building 'Cython.Plex.Scanners' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.6/Cython/Plex/Scanners.o
Cython/Plex/Scanners.c:4:20: error: Python.h: No such file or directory
Cython/Plex/Scanners.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.
error: command 'gcc' failed with exit status 1
Why should I need a 'development version of Python'? Running Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41). Thanks!
You need the developer version of Python - i.e. the Python header files (Python.h)
sudo apt-get install python-dev
You need the headers included in the development version of Python, i.e. python.h. It should be packaged in Ubuntu as python-dev.