Failed scipy installation - python

I need to install scipy 1.2.0 for python2.7 il local on a machine running rhel fedora 6.5 where I do not have sudo permissions.
I have already installed python2.7, numpy, ATLAS and openblas.
Now when I run #python2.7 setup.py build" I get this error:
/home/gspirito/Python-2.7.14/scipy-1.2.0/scipy/cluster/_vq.c:8344: undefined reference to `PyInt_FromLong'
build/temp.linux-x86_64-2.7/scipy/cluster/_vq.o: In function `__Pyx_InitCachedConstants':
/home/gspirito/Python-2.7.14/scipy-1.2.0/scipy/cluster/_vq.c:8134: undefined reference to `PyTuple_Pack'
build/temp.linux-x86_64-2.7/scipy/cluster/_vq.o: In function `__Pyx_modinit_type_import_code':
/home/gspirito/Python-2.7.14/scipy-1.2.0/scipy/cluster/_vq.c:8395: undefined reference to `PyImport_ImportModule'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x26): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
error: Command "/usr/bin/gfortran -Wall -g -L/home/gspirito/src/zlib-1.2.8/lib -L/home/gspirito/packages/include/lzma -L/home/gspirito/src/postgresql-8.4.1/lib -L/home/gspirito/vargenius_bin/R-3.4.1/lib -L/home/gspirito/packages/lib build/temp.linux-x86_64-2.7/scipy/cluster/_vq.o -L/home/gspirito/Python-2.7.14/ATLAS/my_build_dir/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -Lbuild/temp.linux-x86_64-2.7 -latlas -latlas -latlas -lgfortran -o build/lib.linux-x86_64-2.7/scipy/cluster/_vq.so -Wl,--version-script=build/temp.linux-x86_64-2.7/link-version-scipy.cluster._vq.map" failed with exit status 1
Does anyone know how to solve it?
Thanks in advance

The error message displayed essentially says that the linker failed to link all the compiled libraries. The exit status 1 implies that there were several errors before linking thus ld exits. From the Scipy Install page you can essentially see the list of supported python distributions.
For many users, especially on Windows, the easiest way to begin is to
download one of these Python distributions, which include all the key
packages:
Anaconda: A free distribution of Python with scientific packages.
Supports Linux, Windows and Mac.
Enthought Canopy: The free and commercial versions include the core
scientific packages. Supports Linux, Windows and Mac.
Python(x,y): A free distribution including scientific packages, based
around the Spyder IDE. Windows and Ubuntu; Py2 only.
WinPython: Another free distribution including scientific packages and
the Spyder IDE. Windows only, but more actively maintained and
supports the latest Python 3 versions.
Pyzo: A free distribution based on Anaconda and the IEP interactive
development environment. Supports Linux, Windows and Mac.

Related

Python delocate-wheel breaks wheel on MacOS

I'm generating wheel files to support a python distribution on MacOS using delocate. The wheels rely on libraries installed when gcc is installed using Homebrew.
brew install -v gcc#10
/usr/local/Cellar/gcc/10.2.0_3/lib/gcc/10/libstdc++.6.dylib
/usr/local/lib/gcc/10/libgcc_s.1.dylib
When running delocate-wheel with verbose option, the above are the two libraries included in the wheel.
If I use pip to install the original wheel, I can run the program without issue.
After running delicate-wheel and installing the new de-located wheel and trying to run, I produce this error:
python(66449,0x105ea3dc0) malloc: *** error for object 0x1071c3b60: pointer being freed was not allocated
python(66449,0x105ea3dc0) malloc: *** set a breakpoint in malloc_error_break to debug
I have tried using the require-archs=intel, but this errors out, and it appears that I only have single architecture files: Non-fat file: /usr/bin/python is architecture: x86_64
thank you,

MacOS build issues lstdc++ not found while building python package

While trying to install python dependencies on MacOS I encountered a build error.
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
I have xcode installed, and the xcode command line tools, and I use homebrew, so I have gcc 9.1 installed via homebrew.
Another concerning thing I see in the build is this:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7
my concern being that I'm not sure what macosx-10.7 refers to? I'm running mojave (10.14) and xcode is version 10.2.1, so what does 10.7 refer to?
Surprisingly enough, this seems to do the trick (for bash):
export MACOSX_DEPLOYMENT_TARGET=10.9
I'm still not sure what 10.7 is vs 10.9, but this line in the error log:
move to libc++ with a minimum deployment target of OS X 10.9
lead to me discovering that exporting the deployment target effectively did what it was asking for.

Pip, pip3, and conflicting python distributions

I am having trouble installing the python packages PyTransit and ktransit to Anaconda 3 (on Linux). It seems like lots of others have had similar errors, but none of their solutions have worked for me. There's a bunch of stuff going on:
pip install ktransit gives:
/usr/bin/ld: /home/name/anaconda3/lib/libgfortran.a(pause.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/home/name/anaconda3/lib/libgfortran.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
I would try to use ./configure with --enable-shared, but there's no config file. I tried adding extra_compile_args = ["-fPIC"], extra_link_args=["-fPIC"] to setup.py (as in https://github.com/h5py/h5py/issues/851), but that did nothing.
pip install pytransit gives different errors:
#warning "Using deprecated NumPy API, disable it by " \
Warning: src/gimenez.f90:35: Illegal preprocessor directive
Warning: src/gimenez.f90:36: Illegal preprocessor directive
Warning: src/gimenez.f90:37: Illegal preprocessor directive
src/gimenez.f90:271.33:
real(8), dimension(CHUNK_SIZE, npol) :: d
1
Error: Symbol 'chunk_size' at (1) has no IMPLICIT type
Here's where it gets interesting. Using pip3 (or sudo pip) allows ktransit to install successfully, but does nothing for pytransit. Pip and pip3 seem to be tied to different places:
which pip
/home/name/anaconda3/bin/pip
which pip3
/usr/local/bin/pip3
which python
/home/name/anaconda3/bin/python
Lastly, When I try to import ktransit in a jupyter notebook through anaconda, it fails, but when I import ktransit in the Jupyter QtConsole, it succeeds, but seems to contain itself and not provide actual functionality. What I mean is that I can't reference anything within the module, and:
Help on package ktransit:
NAME
ktransit
PACKAGE CONTENTS
ktransit (package)
setup
FILE
(built-in)
I'm thinking that whatever version of python is associated with /usr/bin is somehow messing with me...or maybe there's something wrong with my gcc or libgfortran? I have gcc versions 4.8.5 and 6 (gcc --version gives 4.8.5, but -update-alternatives says there's only one version, 6).
Thanks for taking the time to read this far. I would be very grateful for any suggestions or ideas!
Figured it out -- I uninstalled Anaconda, made sure my python was pointing in the right direction, and then used sudo python -m pip install. Thank you to Nagev for pushing me to get rid of Anaconda!

Error compiling PyGraphviz 1.2 on OSX Mavericks with Xcode 5

G'day everyone,
I am trying to install PyGraphviz 1.2 on OSX Mavericks. I have just upgraded from Mountain Lion and now have Xcode 5.0.1 installed with Command Line Tools. I have downloaded the PyGraphviz source package, unpacked it and ran sudo python setup.py install.
I am getting the following error message (there is some output prior to this, including several warnings):
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/pygraphviz/graphviz_wrap.o -L/usr/local/lib/graphviz -L/usr/local/lib/graphviz -lcgraph -lcdt -o build/lib.macosx-10.9-intel-2.7/pygraphviz/_graphviz.so
ld: library not found for -lcgraph
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
Also, the first two lines of output are:
library_path=/usr/local/lib/graphviz
include_path=/usr/local/include/graphviz
which leads me to believe that compiler knows where to look for libraries.
What could be the problem? Just to make things clear: for technical reasons I have to use Apple's version of Python 2.7 and everything works fine on my other machine with OSX Lion and Xcode 4... (not sure what the exact version is).
I had a same error and resolved it by installing command line tools for XCode. Assuming you upgraded your XCode to 5.0.1, you can install command line tools by typing "xcode-select --install" to terminal and it will prompt you to install command line tools.

Installing Ephem package in Python 3

I would like to install the ephem package in my Python 3.3.0 version under Windows XP.
I tried first the pip install ephem route from the system command prompt. The process aborted with the error message of Unable to find vcvarsall.bat.
I read prior advice on the net for such a difficulty. Following it I installed mingw32 in my computer, added C:\MinGW\bin to the PATH variable and provided Lib / distutils with a new file called distutils.cfg and the content:
[build]
compiler=mingw32
On running now any of the install commands (pip, *easy_install* and setup.py all work the same) the following error results:
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ilibastro-3.7.5 -IC:\Python33\
include -IC:\Python33\include -c extensions/_libastro.c -o build\temp.win32-3.3\
Release\extensions\_libastro.o
cc1.exe: error: unrecognised command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
I have tried to understand and solve the problem, but have been unsuccesful. I have not been able even to find the place in the code where such values are established.
¿Could somebody provide any help? ¿Would ephem be one of the cases alluded by Installing Python modules in the 3.3.0 Documentation with "Not all extensions can be built with MinGW or Cygwin, but many can."?
Thanks in advance
Paco
Here is an extremely useful page of Windows binaries of python packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/.
It includes binaries for pyephem.

Categories

Resources