Error to install lib tables, cant find hdf5 in windows - python

i cant do the isntall of tables lib in my windows enviorment and cant found a solution, the error is about hdf5 intalling and hdf5 directory!
Someone know how can i solve this?
The error is:
C:\Users\thiago.bueno>pip install --upgrade tables
Collecting tables
Using cached https://files.pythonhosted.org/packages/4d/53/8f34ce887c2a2ad8051
8980419a5f6f41defc85a287a355987e559ce9385/tables-3.4.4.tar.gz
Complete output from command python setup.py egg_info:
H5closextvivw_e.c
C:\Users\THIAGO~1.BUE\AppData\Local\Temp\H5closextvivw_e.c(2): warning C4013
: 'H5close' indefinido; assumindo extern retornando int
LINK : fatal error LNK1181: não foi possível abrir o arquivo de entrada 'hdf
5.lib'
* Using Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914
64 bit (AMD64)]
* USE_PKGCONFIG: False
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\THIAGO~1
.BUE\AppData\Local\Temp\pip-install-k7z1g3z5\tables\

To install PyTables from sources you need a lot of prerequisites.
At PyPI there are w32 and w64 binary wheels for Python 2.7, 3.5 and 3.6. If you can change your Python version you can install precompiled PyTables.

If using conda is an option, conda install pytables will most likely fix the issue in a Windows environment (tested on Windows 10, python 3.9, tables 3.6.1).

Related

Error in installing Matplotlib : fatal error C1083

I am relatively new to Python coding and want to learn about statistics and data management in Python. For this I would like to install Matplotlib, which is giving me some issues.
I see other people having this issue, but I have not fully understood how to fix it.
To install i use
pip install matplotlib
I have the following specs installed
Windows 10
Python 3.8
Microsoft Studio 2019
The first error i got was to install Microsoft Studio, so I did that.
I have also attempted to update pip
BUILDING MATPLOTLIB
matplotlib: yes [3.1.1]
python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]]
platform: yes [win32]
...
checkdep_freetype2.c
src/checkdep_freetype2.c(1): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1:
You have python 3.8, not python 3.7.
But there are no python 3.8 wheels available for matplotlib 3.1.1 on pypi. So best remove python 3.8 completely and install python 3.7.
When you then run python -m pip install matplotlib it will install the compiled version from the wheels, so there is no need to compile anything yourself or have Microsoft Studio available.
After spending a lot of time on the issue, this helped me to solve it:
python -m pip install -U matplotlib==3.2.0rc1
FYI: the matplotlib website installation instructions has some info on installing from source.
For Windows it states setting include path and link path:
set CL=/IC:\directory\containing\ft2build.h ...
set LINK=/LIBPATH:C:\directory\containing\freetype.lib ...
As a workaround you may install matplotlib on Windows using the 'Unofficial Windows Binaries for Python Extension Packages' with pip install <downloaded_filename>.
Tested on Python 3.8, Windows 10 and matplotlib-3.2
https://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib

PostgreSQL PL/Python could not load library plpython3u

I am trying to install the PL/Python extension for PostgreSQL. Executing the command CREATE EXTENSION plpython3u; results into the following error message:
ERROR: could not load library "C:/Program Files/PostgreSQL/11/lib/plpython3.dll": The specified module could not be found.
I have:
double checked that the C:\Program Files\PostgreSQL\11\lib\plpython3.dll is present
read the instruction bundled with my installation (doc/installation-notes.html). They mentioned the python version they have used to compile the binaries (Python 3.6.5)
set the PATH to python version 3.6.8 (Python36_64, Python36_64/Scripts)
downloaded embeddable Python version 3.6.5 added this version to the PATH
double checked with both versions 3.6.8 and 3.6.5 that they were found by using this dependency checker Dependencies in both cases it has found the python36.dll
tried 32 bit version of python but the Dependencies checker did not find the python dll so assuming it is using 64 bit.
reopened powershell after each change I did to the PATH variable.
This is my PATH:
I am running:
version
------------------------------------------------------------
PostgreSQL 11.4, compiled by Visual C++ build 1914, 64-bit
(1 row)
Windows 10 Pro 64bit
PostgreSQL EnterpriseDB installation
I was able to resolve this issue by using a workaround by copying the python36.dll (3.6.8) into the system32 folder.
First,you have to verify that python was installed correctly without any bugs,while installing python we have to choose customize installation instead of giving Install now,follow this method this will useful..

how to recompile the bootloader of Pyinstaller

I have an AntiVirus false positive problem of my exe file generated using PyInstaller, by searching i found this answer witch consist of recompiling the bootloader and i just can't get it done.
This what i've tried so far:
try to install C++ build-tools with choco using "choco install -y vcbuildtools" for some reasons the installation failed.
installing visual studio community from here then goes to "cd bootloader" and do python ./waf distclean all got the error can't open file './waf': [Errno 2] No such file or directory
installing MinGW-w64 and setting the path then retry, i got the same error.
Or maybe there is another way to make the executable not detected as virus/trojan.
Packages used : PyQt5, pysnmp, pandas, numpy.
EDIT:
Thanks to #Ana Knickerbocker answer i was able to make a progression, now when i run python ./waf all i got the error :
Python Version : 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
Checking for 'msvc' (C compiler) : not found
Checking for 'gcc' (C compiler) : not found
Checking for 'clang' (C compiler) : not found
could not configure a C compiler!
I guess i still don't have a compiler, i've tried pip install vsbuildtoolsbut i got this message : No matching distribution found for vcbuildtools any ideas ?
Im on Windows 7 x64
Hey you don't need visual studio to build pyinstaller's bootloader, you can do it in your terminal if you have python or python3 installed. It's important to know which one you are using.
I will assume you use python3, try the following steps in your terminal/command line:
1) git clone https://github.com/pyinstaller/pyinstaller
2) cd pyinstaller, then cd bootloader
3) Run “python3 ./waf distclean all” to build the bootloader for your system.
4) Once the bootloader has been built, type in: “python3 setup.py install”
5) This should have installed pyinstaller. Type pyinstaller in the terminal and hit enter. It should recognize the command, but it will complain about more arguments.
6) Use the command "pyinstaller yourfile.py" to create your executable.
Hope this helped!
For anyone getting the error 'could not configure a C compiler!
Simply install a C compiler on your machine.
I installed Visual Studio with C++ compiler as was easier and more legitimate.
https://visualstudio.microsoft.com/vs/features/cplusplus/
The bootloader source is not installed if you are using pip install …. You need to use a source package of PyInstaller (either a git clone or download an archive from github).
GitHub - Bootloader Issue
PyInstaller GitHub

Could not import cufflinks

Problem
I am trying to install both plotly and cufflinks. However I had a problem.
The installation of both plotly and cufflinks were successful. Although, I can't import cufflinks.
Below is a picture of the problem. It seems to be a dependency error:
I tried manually downloading and installing "talib" but I keep getting failures. (Shown below).
talib\common.c(240): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
Any Ideas? I tried re-installing both modules and Anaconda. Nothing So far.
Other infos:
Cufflinks version: 0.11.0
Plotly version: 2.0.10
Anaconda version: 3-4.4.0 (But I don't think it have anything to do with it)
Python version: 3.6.1
try installing this version of cufflinks, it eliminated the error for me.
pip install cufflinks==0.8.2
From this link: github.com/mrjbq7/ta-lib#troubleshooting
Troubleshooting
Sometimes installation will produce build errors like this:
func.c:256:28: fatal error: ta-lib/ta_libc.h: No such file or directory
compilation terminated.
This typically means that it can't find the underlying TA-Lib library, a dependency which needs to be installed. On Windows, this could be caused by installing the 32-bit binary distribution of the underlying TA-Lib library, but trying to use it with 64-bit Python.
Windows
Download ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
This is a 32-bit release. If you want to use 64-bit Python, you will need to build a 64-bit version of the library.
My Fix
So, for windows, we need a 64-bit version of the library? Luckly I found a lot of modules built for 32 and 64 bits python:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
search for "ta-lib" and click on the module you need (In my case cp36 64 bits).
Then, open the command prompt.
Change to where you downloaded the file: cd path/to/file
Type: pip install NameOfFile (in my case pip install TA_Lib‑0.4.10‑cp36‑cp36m‑win_amd64.whl )
Now the 64-bits Ta-Lib module should be installed in your machine. I tested the previous line of codes and it worked!
Thanks for the help :)
I have now removed all dependencies on talib. All studies are pure python based now and you should not face any of this errors.

How to install pytables 3.2 on anaconda?

I use anaconda, and I cannot upgrade with
conda update pytables
it says "already installed".
....
# All requested packages already installed.
# packages in environment at C:\Anaconda:
#
pytables 3.1.1 np19py27_1
Then I tried pip:
C:\Users\HP>pip install --upgrade tables
Collecting tables
Using cached tables-3.2.0.tar.gz
Complete output from command python setup.py egg_info:
H5closecfvx_f.c
r:\temp\H5closecfvx_f.c(2) : warning C4013: 'H5close' undefined; assuming ex
tern returning int
LINK : fatal error LNK1181: cannot open input file 'hdf5dll.lib'
* Using Python 2.7.3 |Anaconda 2.2.0 (32-bit)| (default, Feb 25 2013, 18:26:
30) [MSC v.1500 32 bit (Intel)]
* USE_PKGCONFIG: False
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in r:\temp\pip-build
-rxtig1\tables
I searched my hard disk, and couldn't find hdf5dll.lib file.
Then I downloaded the latest HDF5-1.8.15 Patch1 and point HDF5_DIR to the installed directory, still same error, and there's no hdf5dll.lib file in the newly installed HDF5 directory either.
EDIT: Since the PR below was merged, pytables is available with
conda install -c conda-forge pytables
Also, this package is available in the defaults channel, but only for numpy 1.11.
pip is a pretty difficult way to line these up. A better approach is probably to build a pytables package. One effort to do so is at https://github.com/conda-forge/staged-recipes/pull/1134
Conda packaging makes it much easier to line up all the library dependencies. It essentially allows the burden of build to be centralized, so that not everyone who installs something needs to know how to build it.
Conda forge is a community effort to collaboratively package our ecosystem.

Categories