Configure: error: can't find or link to the hdf5 library - modeling

I get the problem. Error: can't find or link to hdf5 file
I install netcdf 4.9.0 file in linux

Related

Installing torchvision from source libavcodec/avcodec.h not found

I am trying to install torchvision from source, was able to get pytorch installed (needed it from source to use GPU) and now can't get torchvision to work.
I am getting the following error when I run the setup.py:
C:\Users\hoski\vision\torchvision\csrc\cpu\decoder\defs.h(11): fatal error C1083: Cannot open include file: 'libavcodec/avcodec.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe' failed with exit status 2
I downloaded the source for ffmpeg and added it to my path, and I checked the libavcodec folder and the file is there, it just isn't seeing it I guess?
Any advice would be greatly appreciated!
Try change has_ffmpeg = ffmpeg_exe is not None in Setup.py to has_ffmpeg = False

informix DB with RobotFramework

I am trying to connect to informix DB from Robotframework script running on Mac. I have installed Robotframework-Database-Library[1.0.1] from http://franz-see.github.io/Robotframework-Database-Library/.
tried to install Informix DB per https://wiki.python.org/moin/Informix. Ran into issue
error: Can't find esql. Please set INFORMIXDIR correctly.
tried to install mxODBC using python. still running into error
I have installed egenix-mx-base-3.2.9-py2.7_ucs2-macosx-10.5-x86_64-prebuilt as this is precondition. Tried to verify the mx-base using.
$ pip install egenix-mx-base
Requirement already satisfied: egenix-mx-base in /Library/Python/2.7/site-packages.
Then tried to install egenix-mxodbc-3.3.6-py2.7_ucs2-macosx-10.4-fat-prebuilt.
msuresh$ python setup.py install
running install
found usable build data file 'build/build-py2.7_ucs2.pck'
prebuilt archive found: skipping the build process and loading the prebuilt archive
setting platform to 'macosx-10.4-fat'
adjusting distutils platform string from 'macosx-10.13-x86_64' to 'macosx-10.4-fat'
restoring build data from a previous build run
loaded build data for platform 'macosx-10.4-fat'
running install_lib
writing byte-compilation script '/var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py'
/usr/local/opt/python#2/bin/python2.7 -O /var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py
removing /var/folders/dc/nwlkjl0129d3qm1j8m5czmgsnkqkf_/T/tmpRNEu3H.py
running install_data
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/egenix_mxodbc-3.3.6-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/egenix_mxodbc-3.3.6-py2.7.egg-info
But on trying to verify mxodbc --> does through me error.
>>> import mx.ODBC.Manager
Traceback (most recent call last):
File "", line 1, in
File "mx/ODBC/Manager/__init__.py", line 48, in
ImportError: None of the supported ODBC managers unixODBC, iODBC or DataDirect could be imported: dlopen(/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so: no matching architecture in universal wrapper
/usr/local/lib/python2.7/site-packages/mx/ODBC/unixODBC/mxODBC.so: no matching architecture in universal wrapper, dlopen(/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so: no matching architecture in universal wrapper
/usr/local/lib/python2.7/site-packages/mx/ODBC/iODBC/mxODBC.so: no matching architecture in universal wrapper, No module named DataDirect
.. Any help to get informix connection via Robotframework would be appreciated.
It sounds like you need to download and install the Informix Client SDK from here

cx_Oracle: distutils.errors.DistutilsSetupError: cannot locate Oracle include files

I need install cx_Oracle for Python 2.5 on Linux (Linux 2.6.18-371.1.2.el5 i686). I have installed Oracle client 10.2.0.4.
I have tried following:
1. Download cx_Oracle tar.gz from http://sourceforge.net/projects/cx-oracle/files/.
I don't know which of listed version are suitable for python 2.5 and Oracle client 10.2.0.4, so try cx_Oracle-5.1.tar.gz. Unpacked tar,
go to unpacked folder and run python setup.py install. I got error:
Traceback (most recent call last):
File "setup.py", line 187, in <module>
raise DistutilsSetupError("cannot locate Oracle include files")
distutils.errors.DistutilsSetupError: cannot locate Oracle include files
In .bash_profile I have setted oracle path:
export ORACLE_HOME=/usr/oracle/10.2.0.4/client
export PATH=$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
How fix such error, maybe I need another version of cx_Oracle tar?
Run pip install cx_Oracle. Got error:
Downloading/unpacking cx-Oracle
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement cx-Oracle
No distributions at all found for cx-Oracle
Could someone advise me right solution?
Update
After suggestion in response I got following error:
...
cx_Oracle.c:496: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:497: error: âOCI_UCBTYPE_EXITâ undeclared (first use in this function)
cx_Oracle.c:497: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
cx_Oracle.c:498: error: âOCI_UCBTYPE_REPLACEâ undeclared (first use in this function)
cx_Oracle.c:498: warning: passing argument 3 of âPyModule_AddIntConstantâ makes integer from pointer without a cast
error: command 'gcc' failed with exit status 1
When you run setup.py it will check for any of these folders on your ORACLE_HOME.
possibleIncludeDirs = ["rdbms/demo", "rdbms/public", "network/public",
"sdk/include"]
Also the instant client sometimes places the include files, such as oci.h, in /usr/include/oracle//client, if there is no 'include' directory under ORACLE_HOME create a symbolic link to it.
sudo ln -s /usr/include/oracle/11.2/client $ORACLE_HOME/include
Looks like you're missing the Client SDK
Make sure you install the instant client sdk for you OS.
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Install oracle_client_basic
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
Using pip install
python -m pip install cx_Oracle
Adding ldconfig
Find your client location, for example: /u01/app/oracle/product/11.2.0/client_1/lib
vi /etc/ld.so.conf.d/oracle.conf
Add this location into it:
/u01/app/oracle/product/11.2.0/client_1/lib
ldconfig
import cx_oracle
Make sure that you've a client sdk present in your path.
Also I had to do add this to my .bash_rc
export DYLD_LIBRARY_PATH=$ORACLE_HOME
In addition to this, Python 2.7 does not come with Python.h which is available by default in Python 3.4. So I would also suggest to install python-devel package
yum install python-devel
That should resolve the issue.

Scipy not working with python 3 but does with 2.6(default)

I have installed Scipy by build and install from the terminal. But I get the following error when I try to execute the following simple code:
from scipy.stats.mstats_basic import gmean
ab=[1,2,3,4,5,6]
print(gmean(ab))
This is the error I am getting:
Traceback (most recent call last):
File "/home/prashanthb/workspace/rankalgo/rough1.py", line 2, in <module>
from scipy.stats.mstats_basic import gmean
File "/usr/local/lib/python3.1/dist-packages/scipy/stats/__init__.py", line 321, in <module>
File "/usr/local/lib/python3.1/dist-packages/scipy/stats/stats.py", line 194, in <module>
File "/usr/local/lib/python3.1/dist-packages/scipy/special/__init__.py", line 525, in <module>
ImportError: No module named _cephes
But the same code works when I switch to the default interpreter python 2.6. I have installed Libatlas and lapack before and Numpy(already installed under python3) seems to work well.
I have got mpmath installed too.
Question: How to proceed from here to get it to work with python3? If anybody knows any other library to calculate geometric mean please do mention.
Thanks in advance
prashanth
UPDATE: I found this while building setup.py it again:
DeprecationWarning)
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize LaheyFCompiler
Could not locate executable lf95
customize PGroupFCompiler
Could not locate executable pgfortran
customize AbsoftFCompiler
Could not locate executable f90
customize NAGFCompiler
Found executable /usr/bin/f95
customize VastFCompiler
customize CompaqFCompiler
Could not locate executable fort
customize IntelItaniumFCompiler
Could not locate executable efort
Could not locate executable efc
customize IntelEM64TFCompiler
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
compiling '_configtest.c':

Matplotlib pylab savefig runtime error in python 3.2.3

I am trying to test whether matplotlib installed properly in python3. I am following this basic tutorial: http://www.scipy.org/Plotting_Tutorial
This question is similar to one asked previously but unfortunately did not report the final solution explicitly and this is a different operating system.
The operating system for this is Mac OS X 10.6.8. Running the script in Python 3.2 does not work, but running it in Python 2.7 does. Unfortunately I need 3.2.
When the savefig line is commented out, it works fine.
"""
Example: simple line plot.
Show how to make and save a simple line plot with labels, title and grid
"""
import numpy
import pylab
t = numpy.arange(0.0, 1.0+0.01, 0.01)
s = numpy.cos(2*2*numpy.pi*t)
pylab.plot(t, s)
pylab.xlabel('time (s)')
pylab.ylabel('voltage (mV)')
pylab.title('About as simple as it gets, folks')
pylab.grid(True)
pylab.savefig('/Users/USERNAME/Documents/simple_plot.png', format='png')
pylab.show()
The code above returned the same error regardless of whether the path was set explicitly. I tried the following in addition to the above:
pylab.savefig('simple_plot.png', format='png')
pylab.savefig('simple_plot')
I tried setting the path explicitly as the other question said (as in the longer example above), but that resulted in the following errors. Note: mplex.py is the name of the script.
libpng warning: Application was compiled with png.h from libpng-1.2.44
libpng warning: Application is running with png.c from libpng-1.4.11
libpng warning: Incompatible libpng version in application and library
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mplex.py", line 16, in <module>
pylab.savefig('/Users/USERNAME/Documents/simple_plot.png', format='png')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/pyplot.py", line 474, in savefig
return fig.savefig(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/figure.py", line 1225, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py", line 2075, in print_figure
**kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py", line 1846, in print_png
return agg.print_png(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_agg.py", line 497, in print_png
filename_or_obj, self.figure.dpi)
RuntimeError: Could not create write struct
Ideas? Is there another way to explicitly set the destination aside from what I tried in the savefig line?
I'm not sure what package manager you're using, and I'm on Python 2.7 (not 3.2.3), but I'm using Fink and had a similar problem (with different libpng version numbers).
In iPython --pylab, I was seeing this:
In [3]: savefig('foo.png')
libpng warning: Application is running with png.c from libpng-1.4.11
libpng warning: Incompatible libpng version in application and library
libpng warning: Application was compiled with png.h from libpng-1.5.11
Checking my Fink installations of libpng, I saw this:
$ fink list libpng
Information about 6268 packages read in 0 seconds.
i libpng14 1.4.11-1 PNG image format handling library
i libpng14-shlibs 1.4.11-1 Shared libraries for libpng14 package
libpng15 1.5.10-1 PNG image format handling library
libpng15-32bit 1.5.10-1 PNG library (32-bit)
libpng15-32bit-shli 1.5.10-1 Shared libraries for libpng15 package
i libpng15-shlibs 1.5.10-1 Shared libraries for libpng15 package
libpng3 1:1.2.49-1 PNG image format handling library
libpng3-shlibs 1:1.2.49-1 Shared libraries for libpng3 package
i system-pkgconfig-li 1.5.11-1 [virtual pkgconfig package representing libpng]
i system-pkgconfig-li 1.5.11-1 [virtual pkgconfig package representing libpng15]
After running "fink install libpng15", my libpng package versions looked like this:
$ fink list libpng
Information about 6268 packages read in 1 seconds.
libpng14 1.4.11-1 PNG image format handling library
i libpng14-shlibs 1.4.11-1 Shared libraries for libpng14 package
i libpng15 1.5.10-1 PNG image format handling library
libpng15-32bit 1.5.10-1 PNG library (32-bit)
libpng15-32bit-shli 1.5.10-1 Shared libraries for libpng15 package
i libpng15-shlibs 1.5.10-1 Shared libraries for libpng15 package
libpng3 1:1.2.49-1 PNG image format handling library
libpng3-shlibs 1:1.2.49-1 Shared libraries for libpng3 package
i system-pkgconfig-li 1.5.11-1 [virtual pkgconfig package representing libpng]
i system-pkgconfig-li 1.5.11-1 [virtual pkgconfig package representing libpng15]
As you can see, libpng14 is no longer installed and libpng15 is installed.
Next, "pip uninstall matplotlib" and "pip install matplotlib" yields a matplotlib build summary like this:
$ pip install matplotlib
Downloading/unpacking matplotlib
Downloading matplotlib-1.2.0.tar.gz (36.9Mb): 36.9Mb downloaded
Running setup.py egg_info for package matplotlib
basedirlist is: ['/usr/local/', '/usr', '/usr/X11', '/opt/local']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.2.0
python: 2.7.3 (default, Jul 27 2012, 16:40:57) [GCC 4.2.1
Compatible Apple Clang 3.1
(tags/Apple/clang-318.0.61)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.2
freetype2: 15.0.9
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.5.10
Tkinter: Tkinter: 81008, Tk: 8.5, Tcl: 8.5
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: yes
Qt: no
Qt4: no
PySide: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
dateutil: 1.5
pytz: 2012b
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 9.05
latex: no
You can see that the build will now pick up libpng 1.5.10. Previously, it was picking up 1.4.11 for the build.
Avoid using the standard console and the error will not appear by double clicking the yourcode.py or yourcode.pyw file.

Resources