the Installation of Python Pandas on OpenSuse 42.3 does not work correctly -

good day dear experts

the Installation of Python Pandas on OpenSuse 42.3 does not work correctly - i guess that i struggle with some bad bad errors…

see the following issues and the protocol :

  Downloading pandas-0.22.0.tar.gz (11.3MB)
    100% |████████████████████████████████| 11.3MB 62kB/s 
    Complete output from command python setup.py egg_info:
    non-existing path in 'numpy/distutils': 'site.cfg'
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable ifort
    Could not locate executable ifc
    Could not locate executable lf95
    Could not locate executable pgfortran
    Could not locate executable f90
    Could not locate executable f77
    Could not locate executable fort
    Could not locate executable efort
    Could not locate executable efc
    Could not locate executable g77
    Could not locate executable g95
    Could not locate executable pathf95
    Could not locate executable nagfor
    don't know how to compile Fortran code on platform 'posix'
    Running from numpy source directory.                                                                                                                                                        
    /tmp/easy_install-j3aosykh/numpy-1.14.1/setup.py:369: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates                       
      run_build = parse_setuppy_commands()                                                                                                                                                      
    /usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'                                                                                     
      warnings.warn(msg)                                                                                                                                                                        
    /tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      self.calc_info()
    /tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      self.calc_info()
    /tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      self.calc_info()
    /tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    /tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
    /usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    /usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
        yield saved
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
        yield
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
        return func()
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/setup.py", line 394, in <module>
    
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/setup.py", line 386, in setup_package
    
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
      File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
        self.run_command("egg_info")
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 294, in build_library_sources
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
      File "numpy/core/setup.py", line 675, in get_mathlib_info
        'pandas.tests.computation',
    RuntimeError: Broken toolchain: cannot link a simple C program
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-9jb46c5p/pandas/setup.py", line 743, in <module>
        **setuptools_kwargs)
      File "/usr/lib64/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 268, in __init__
        self.fetch_build_eggs(attrs'setup_requires'])
      File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 836, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1081, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1093, in obtain
        return installer(requirement)
      File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 645, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 675, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 858, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1086, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1072, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 240, in run_setup
        raise
      File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
        yield
      File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 164, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 139, in resume
        compat.reraise(type, exc, self._tb)
      File "/usr/lib/python3.4/site-packages/setuptools/compat.py", line 65, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
        yield saved
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
        yield
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
        return func()
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/setup.py", line 394, in <module>
    
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/setup.py", line 386, in setup_package
    
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
      File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
        self.run_command("egg_info")
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 294, in build_library_sources
      File "/tmp/easy_install-j3aosykh/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
      File "numpy/core/setup.py", line 675, in get_mathlib_info
        'pandas.tests.computation',
    RuntimeError: Broken toolchain: cannot link a simple C program
    /bin/bash: gcc: Kommando nicht gefunden.
    /bin/bash: gcc: Kommando nicht gefunden.
    

well i guess i have some basic errors that cause the installation of panda via pip

see this

 RuntimeError: Broken toolchain: cannot link a simple C program

look forward to hear from you

Is your Python Panda from PyPi instead of an openSUSE repo?
And if os, is your python setup tools from PyPi?
May be a requirement or at a strong recommendation since it appears that your Python Pandas appears to be downloading from somewhere(I suspect not from an openSUSE repo).

You may also want to consider downloading and running your entire python from PyPi instead of from openSUSE if you’re downloading packages from PyPi… To do this, I’d recommend utilizing virtualenv and Pyenv to manage your virtualenv instances as described in the Development Forum thread starting with this post

https://forums.opensuse.org/showthread.php/529448-installing-python-3-6-on-leap?p=2853711#post2853711

TSU

hello dear TSU

i do not have much time now - so this answer is a very very short one!!! i have to leave house in only one minute!

i guess so:

Python Panda from PyPi instead of an openSUSE repo?

well i guess so. - i entered pip install panda in the comandline (terminal)

so this cannot be regarded as a repo-install.

i will have a closer look at your recommendation .

You may also want to consider downloading and running your entire python from PyPi instead of from openSUSE if you’re downloading packages from PyPi… To do this, I’d recommend utilizing virtualenv and Pyenv to manage your virtualenv instances as described in the Development Forum thread starting with this post

many any thanks for all your help

i do not have much time now - so this answer is a very very short one!!! i have to leave house in only one minute!
i will respond later…:wink:

greetings

What is the output of:

zypper se -is gcc

just a note (i dont know your level of knowledge) - to get a full python development environment (with zero hassle) separate from the native python i installed anaconda distribution. If you go this route i can show how to seamlessly switch between environments.

Anaconda does a lot more than provide its own python, it also provides its own library of apps.
The anaconda apps I’m a bit familiar with are some data analysis tools.

On the other hand,
My suggestion (to use a standard virtualenv plus “better” management tools) points to the official python repository with apps from the same repository (not a special collection of apps).
If the pip tool is being used as described, the problem app is already from the official Python repo, so it should make some sense to use python and setup tools from the same source.

TSU

Unless I’m missing something,
The @OP is working only in python, not C.

TSU

See the bottom of the error output.

pip won’t install dependencies outside of python packages on pypi.

I interpret the C error only as a result of python setup errors… initially, various executables weren’t found for whatever reason, so then the python install branched into a routine that was meant to eventually include C but even that python routine failed.

So,
It’s a case of determining the earliest cause(s) of the cascade of errors… I think that until critical python errors are addressed you won’t arrive at any late errors.

But, we’ll see what happens…

TSU

hello dear all

many thanks for the replies and the hints - here a quick output on the code … that i shoud have runned in order to test the gcc - things…

it starts with a hint that packman is too old …!!?

Repository 'Packman Repository' ist veraltet. Sie können 'zypper refresh' als root ausführen, um es zu aktualisieren.
Repository 'packman' ist veraltet. Sie können 'zypper refresh' als root ausführ
en, um es zu aktualisieren.
Repository 'openSUSE-Leap-42.3-Update' ist veraltet. Sie können 'zypper refresh' als root ausführen, um es zu aktualisieren.
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...

S  | Name            | Typ   | Version           | Arch   | Repository               
---+-----------------+-------+-------------------+--------+--------------------------
i+ | libgcc_s1       | Paket | 7.2.1+r253435-3.2 | x86_64 | openSUSE-Leap-42.3-Update
i+ | libgcc_s1-32bit | Paket | 7.2.1+r253435-3.2 | x86_64 | openSUSE-Leap-42.3-Update
martin@linux-3645:~/dev/python> 

this above results i have got…

what do they say here…!?

I would try:

zypper in gcc

or

zypper in -t pattern devel_basis

i havnt worked with python in quite some years but… pandas requires numpy which is mostly C/fortran. If i remember correctly python install systems have great trouble with foreign binaries (they tried to address this with the wheel packaging?), i think numpy often has to be compiled on the users system. The large scientific distributions became so popular (i think) since they circumvent these problems associated with scientific packages.

> Anaconda does a lot more than provide its own python, it also provides its own library of apps.
yes they supply a huge scientific stack, all open source, some of which are written by the company (and are fantastic i.e. bokeh).

yes virtual env is fantastic if you want to base off the native python, be selective on package installs and protect the native python installation.

‘if’ you are a noob and your also exploring things like jupyter, visualisation etc etc then i would recommend the ready rolled stack. If you know what you want and what your doing, then ignore this and do your own thing.

According to the Panda project page, Anaconda is an option…

You can download from PyPi or Anaconda, or,
It’s also possible to build from source. Building from source will likely guarantee latest features and fixes… Simply clone the git repo, install the 3 dependencies and run the setup. Downside of course is that you won’t get automatic updates, but you can rebuild from source any time.
Andaconda should be a good available option, it’s been my impression that attention is paid to making sure all works as expected.
PyPi install should work, too.

But, IMO hybrid use of packages from different sources like openSUSE with PyPi packages <might> cause a problem.

Following describes your install options
https://github.com/pandas-dev/pandas/

I think nowadays numpy should be used for interoperability with C code so numpy itself shouldn’t need to be compiled…
http://www.numpy.org/

TSU

In addition to devel_basis you might also need gcc-fortran and python3-devel.

https://stackoverflow.com/a/37145552

dear all - hello dear TSU - dear ravas and all

started with this

zypper in gcc
zypper in -t pattern devel_basis


then i also did the following

https://stackoverflow.com/questions/22388519/problems-with-pip-install-numpy-runtimeerror-broken-toolchain-cannot-link-a/37145552#37145552

zypper install python3-devel
zypper install subversion
zypper install pandas 

then i got back the following



Paket python3-devel-3.4.6-11.1.x86_64 abrufen                                                                                                              (1/1), 135,7 KiB (495,8 KiB entpackt)
Abrufen: python3-devel-3.4.6-11.1.x86_64.rpm .............................................................................................................................[fertig (424,7 KiB/s)]
Überprüfung auf Dateikonflikte läuft: ..................................................................................................................................................[fertig]
(1/1) Installieren: python3-devel-3.4.6-11.1.x86_64 ....................................................................................................................................[fertig]
linux-3645:/home/martin # zypper install subversion
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...
'subversion' ist bereits installiert.
Kein Aktualisierungskandidat für 'subversion-1.9.7-8.1.x86_64'. Die neueste Version ist bereits installiert.
Paketabhängigkeiten werden aufgelöst...

Keine auszuführenden Aktionen.
linux-3645:/home/martin # zypper install numpy
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...
'numpy' wurde in den Paketnamen nicht gefunden. Fähigkeiten werden durchsucht.
'python-numpy', welches 'numpy' bietet, ist bereits installiert.
Paketabhängigkeiten werden aufgelöst...

Keine auszuführenden Aktionen.
linux-3645:/home/martin # zypper install numpy
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...
'numpy' wurde in den Paketnamen nicht gefunden. Fähigkeiten werden durchsucht.
'python-numpy', welches 'numpy' bietet, ist bereits installiert.
Paketabhängigkeiten werden aufgelöst...

Keine auszuführenden Aktionen.
linux-3645:/home/martin # zypper install pandas 
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...
'pandas' wurde in den Paketnamen nicht gefunden. Fähigkeiten werden durchsucht.
Keine Anbieter von 'pandas' gefunden.
Paketabhängigkeiten werden aufgelöst...

Keine auszuführenden Aktionen.
linux-3645:/home/martin # 


Keine auszuführenden Aktionen. → in other words: nothing to do…

conclusio; panda is still __ not __ installed;



import lxml.html as LH
import requests
import pandas as pd
def text(elt):
    return elt.text_content().replace(u'\xa0', u' ')

url = 'http://www.fdmbenzinpriser.dk/searchprices/5/'
r = requests.get(url)
root = LH.fromstring(r.content)

for table in root.xpath('//table@id="sortabletable"]'):
    header = [text(th) for th in table.xpath('//th')]        # 1
    data = [text(td) for td in tr.xpath('td')]  
            for tr in table.xpath('//tr')]                   # 2
    data = [row for row in data if len(row)==len(header)]    # 3 
    data = pd.DataFrame(data, columns=header)                # 4
    print(data)


see the following:


martin@linux-3645:~/dev/python> python3 pan1.py
Traceback (most recent call last):
  File "pan1.py", line 4, in <module>
    import pandas as pd
ImportError: No module named 'pandas'
martin@linux-3645:~/dev/python> 

well there is still something wrong…

You will again need to run

pip3 install pandas

as the superuser, or as a normal user:

pip3 install --user pandas

What is the output of that?

good day dear ravas,

many thanks - i runned this code

linux-3645:/home/martin # pip3 install pandas
Collecting pandas
  Downloading pandas-0.22.0.tar.gz (11.3MB)
    100% |████████████████████████████████| 11.3MB 47kB/s 
Collecting python-dateutil>=2 (from pandas)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 128kB/s 
Requirement already satisfied: pytz>=2011k in /usr/lib/python3.4/site-packages (from pandas)
Collecting numpy>=1.9.0 (from pandas)
  Downloading numpy-1.14.1-cp34-cp34m-manylinux1_x86_64.whl (12.1MB)
    100% |████████████████████████████████| 12.1MB 36kB/s 
Requirement already satisfied: six>=1.5 in /usr/lib/python3.4/site-packages (from python-dateutil>=2->pandas)
Installing collected packages: python-dateutil, numpy, pandas
  Running setup.py install for pandas ... done
Successfully installed numpy-1.14.1 pandas-0.22.0 python-dateutil-2.6.1
linux-3645:/home/martin # pip3 install --user pandas
Requirement already satisfied: pandas in /usr/lib64/python3.4/site-packages
Requirement already satisfied: python-dateutil>=2 in /usr/lib/python3.4/site-packages (from pandas)
Requirement already satisfied: pytz>=2011k in /usr/lib/python3.4/site-packages (from pandas)
Requirement already satisfied: numpy>=1.9.0 in /usr/lib64/python3.4/site-packages (from pandas)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.4/site-packages (from python-dateutil>=2->pandas)
linux-3645:/home/martin # 


love to hear from you

It looks like it installed without error.

Note that installing with the --user flag
will put the package in your home directory as returned by

python3 -m site --user-site

If you want it for the whole system,
then you login with su and exclude the flag.

hello again - now it runs like a charme

MANY Thanks for your continued help

greetings

martin@linux-3645:~/dev/python> python3 -m site --user-site
/home/martin/.local/lib/python3.4/site-packages
martin@linux-3645:~/dev/python>