Installing a program PHOEBE 2 - installation

Here are the instructions: Download & Install PHOEBE 2.1.6
First attempt:
pip install numpy phoebe
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.11.0) Collecting phoebe Using cached https://files.pythonhosted.org/packages/86/18/65d72fe5cf21c9e678d81408566a535026c782327869b7dcbffecd347de5/phoebe-2.1.6.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-ty7hrmts/phoebe/setup.py", line 6 print "Numpy is needed for running and building of PHOEBE" ^ SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ty7hrmts/phoebe/ You are using pip version 19.0.3, however version 19.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
Second attempt from https://github.com/phoebe-project/phoebe2
I have problem with
python setup.py build
python setup.py build /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "libphoebe" sources building extension "phoebe.algorithms.ceclipse" sources build_src: building npy-pkg config files running build_py running build_ext customize UnixCCompiler customize UnixCCompiler using build_check customize UnixCCompiler customize UnixCCompiler using build_check OS: Linux OS version: 4.10.0-38-generic sh: 1: c++: not found Compiler: c++ Compiler version: C compiler: i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC
compile options: '-I/usr/include/python2.7 -c' i686-linux-gnu-gcc: /tmp/6KUBK1XJLW_compiler_check.c i686-linux-gnu-gcc -pthread /tmp/6KUBK1XJLW_compiler_check.o -o /tmp/6KUBK1XJLW_compiler_check.exe Ready to compile with gcc 5.4.0 . OS: Linux OS version: 4.10.0-38-generic Compiler: i686-linux-gnu-gcc Compiler version: i686-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Ready to compile with gcc 5.4.0. extra_args=['-std=c++11'] extra_args=[] building 'libphoebe' extension compiling C++ sources C compiler: c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC
compile options: '-I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c' extra options: '-std=c++11' c++: ./phoebe/lib/libphoebe.cpp sh: 1: c++: not found sh: 1: c++: not found error: Command "c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c ./phoebe/lib/libphoebe.cpp -o build/temp.linux-i686-2.7/phoebe/lib/libphoebe.o -std=c++11" failed with exit status 127
c++: not found
I tried it install by
sudo apt install c++
but it was not successful
Third attempt, I tried:
pip2 install --user phoebe
and I get an error about c++ again
What I do wrong please? Thank you
The error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/betka/.local/lib/python2.7/site-packages/phoebe/__init__.py", line 276, in <module>
from .dependencies.unitsiau2015 import u,c
File "/home/betka/.local/lib/python2.7/site-packages/phoebe/dependencies/__init__.py", line 1, in <module>
from . import autofig
File "/home/betka/.local/lib/python2.7/site-packages/phoebe/dependencies/autofig/__init__.py", line 17, in <module>
from .call import Plot, Mesh
File "/home/betka/.local/lib/python2.7/site-packages/phoebe/dependencies/autofig/call.py", line 2, in <module>
import astropy.units as u
File "/home/betka/.local/lib/python2.7/site-packages/astropy/__init__.py", line 116, in <module>
_check_numpy()
File "/home/betka/.local/lib/python2.7/site-packages/astropy/__init__.py", line 104, in _check_numpy
from .utils import minversion
ImportError: No module named utils

First, try to install build tool How to install G++ the C++ compiler on Ubuntu
sudo apt install g++
sudo apt install build-essential
Then try again.

Related

Rstudio unable to install package devtools: gcc error

I want to install package devtools. But after successful downloading of all dependencies, it gives error while installing of the form:
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rawmatch.c -o rawmatch.o
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'rawmatch.o' failed
make: *** [rawmatch.o] Error 1
ERROR: compilation failed for package ‘mime’
* removing ‘/usr/local/lib/R/site-library/mime’
I have checked gcc. I am able to run a sample c program file from terminal.
It seems you'll need to use a more recent gcc version, 4.9 at least.
Both unrecognized options, -fstack-protector-strong and -Wdate-time, were introduced in gcc 4.9 (release notes).

Installing geopandas on Python 2.6

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.

Error trying to upgrade Pillow on Mac

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

i have an error when executing "from lxml import etree" in the python command line after successfully installed lxml by pip

bash-3.2$ pip install lxml-2.3.5.tgz
Unpacking ./lxml-2.3.5.tgz
Running setup.py egg_info for package from file:///Users/apple/workspace/pythonhome/misc/lxml-2.3.5.tgz
Building lxml version 2.3.5.
Building with Cython 0.17.
Using build configuration of libxslt 1.1.27
Building against libxml2/libxslt in the following directory: /usr/local/lib
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 2.3.5.
Building with Cython 0.17.
Using build configuration of libxslt 1.1.27
Building against libxml2/libxslt in the following directory: /usr/local/lib
skipping 'src/lxml/lxml.etree.c' Cython extension (up-to-date)
building 'lxml.etree' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/etree.so
skipping 'src/lxml/lxml.objectify.c' Cython extension (up-to-date)
building 'lxml.objectify' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace
llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/objectify.so
Successfully installed lxml
Cleaning up...
bash-3.2$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>> import html
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named html
>>> from lxml import html
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/html/__init__.py", line 12, in
from lxml import etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
get same error again for older version lxml2.3.4
bash-3.2$ pip install lxml-2.3.4.tgz
Unpacking ./lxml-2.3.4.tgz
Running setup.py egg_info for package from file:///Users/apple/workspace/pythonhome/misc/lxml-2.3.4.tgz
Building lxml version 2.3.4.
Building with Cython 0.17.
Using build configuration of libxslt 1.1.27
Building against libxml2/libxslt in the following directory: /usr/local/lib
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 2.3.4.
Building with Cython 0.17.
Using build configuration of libxslt 1.1.27
Building against libxml2/libxslt in the following directory: /usr/local/lib
skipping 'src/lxml/lxml.etree.c' Cython extension (up-to-date)
building 'lxml.etree' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/etree.so
skipping 'src/lxml/lxml.objectify.c' Cython extension (up-to-date)
building 'lxml.objectify' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace
llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/objectify.so
Successfully installed lxml
Cleaning up...
bash-3.2$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import lxml
>>> from lxml import etree
Traceback (most recent call last):
File "", line 1, in
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
See also get errors when import lxml.etree to python
I think the key error here is this:
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister
I found another person with the same problem on an lxml dev list.
Their suggestion:
You probably need to check your libxml/libxslt libraries. Make sure you have the versions required in the lxml installation instructions
Start by running
ldd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
That will show if you have any unresolved shared libraries. You may need to install/update some packages.
Check the thread linked above for more troubleshooting tips.
Hey I've tried to use Conda environment and it worked. The default venv seems to work horribly on M1 silicon.
You will have to install via this conmmand:
conda install -c conda-forge requests-html

pyzmq error when loading the module

I am trying to install pyzmq to get ipython wotking in qtconsole mode.
I have installed zeromq in the default location (/usr/local). Both the dynamic lib and the header are at the correct position.
The I cloned the git repo for pyzmq and run the configuration command :
[root#XXXXX pyzmq]# python setup.py configure --zmq=/usr/local
running configure
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /usr/local
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/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
gcc -pthread detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/vers
ZMQ version detected: 2.2.0
************************************************
So far so good. Then I run the installation command :
[root#XXXXXX pyzmq]# python setup.py install
running install
running build
running build_py
running build_ext
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /usr/local
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/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
gcc -pthread detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/vers
ZMQ version detected: 2.2.0
************************************************
skipping 'zmq/core/_poll.c' Cython extension (up-to-date)
skipping 'zmq/core/_version.c' Cython extension (up-to-date)
skipping 'zmq/core/constants.c' Cython extension (up-to-date)
skipping 'zmq/core/context.c' Cython extension (up-to-date)
skipping 'zmq/core/device.c' Cython extension (up-to-date)
skipping 'zmq/core/error.c' Cython extension (up-to-date)
skipping 'zmq/core/message.c' Cython extension (up-to-date)
skipping 'zmq/core/socket.c' Cython extension (up-to-date)
skipping 'zmq/core/stopwatch.c' Cython extension (up-to-date)
skipping 'zmq/utils/initthreads.c' Cython extension (up-to-date)
skipping 'zmq/utils/rebuffer.c' Cython extension (up-to-date)
skipping 'zmq/devices/monitoredqueue.c' Cython extension (up-to-date)
running install_lib
running install_egg_info
Writing /usr/lib64/python2.7/site-packages/pyzmq-2.2dev-py2.7.egg-info
Then I try to load the module in python :
>>> import zmq
This works (after having added the --inplace in the setup.py command)
But when I start ipython qtconsole I get this error (after several other lines):
import zmq
File "/usr/lib64/python2.7/site-packages/zmq/__init__.py", line 29, in <module>
from zmq import core, devices
File "/usr/lib64/python2.7/site-packages/zmq/core/__init__.py", line 26, in <module>
from zmq.core import (constants, error, message, context,
File "message.pxd", line 39, in init zmq.core.poll (zmq/core/poll.c:2950)
ValueError: zmq.core.message.Message has the wrong size, try recompiling
Any idea where this could come from ?
#akira - It could be that you checkout the tag (v2.2.0) from their github repository. I saw the same issue by doing so. Then I downloaded the tar.gz for v2.2.0 from pypi and it worked fine.

Resources