This is what I am getting:
Adnans-MBP:~ AdnanAhmad$ easy_install psycopg2
Searching for psycopg2
Reading https://pypi.python.org/simple/psycopg2/
Downloading https://pypi.python.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz#md5=4a392949ba31a378a18ed3e775a4693f
Best match: psycopg2 2.6.2
Processing psycopg2-2.6.2.tar.gz
Writing /var/folders/d3/t5c58nx570ggzzknhm4zpjnw0000gn/T/easy_install-66rCLK/psycopg2-2.6.2/setup.cfg
Running psycopg2-2.6.2/setup.py -q bdist_egg --dist-dir /var/folders/d3/t5c58nx570ggzzknhm4zpjnw0000gn/T/easy_install-66rCLK/psycopg2-2.6.2/egg-dist-tmp-Vu8qsu
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:31:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
^
1 error generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I am using PostgreSql.app
well, since you are using anaconda anyways, might as well take advantage of their binary packages! They have one for PostgreSQL! just type
conda install psycopg2
Related
I'm trying to install python-rocksdb on a windows 10 machine and I'm coming across some issues with the install.
I have successfully installed rocksdb first using the vcpkg method.
When running pip install python-rocksdb I get the following error:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Looking around suggested attempting to install with GCC or G++, so I downloaded cygwin and then attempted to install the python package using
pip install --global-option build_ext --global-option --compiler=cygwin python-rocksdb which yielded the following error:
gcc: error: unrecognized command-line option ‘-mcygwin’
error: command 'C:\\cygwin64\\bin\\gcc.exe' failed with exit code 1
This post seems to suggest that you need to use g++ specifically, but it looks like the cygwin command is defaulting to gcc.
Just note that I'm not using the virtual env with python.
Any assistance is greatly appreciated.
I'm trying to install psycopg2 module on python3 on a CentOS Linux 7 and getting the following error
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:36:22: fatal error: libpq-fe.h: No such file or directory
#include <libpq-fe.h>
^
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'gcc' failed with exit status 1
Any ideas as to what the solution would be?
Thanks
Just trying to run a
pip install CrossMap
on OSX 10.11.6 with a brew installed python (version 2.7.12) and pip (version 9.0.1) and running into this error:
htslib/hts_os.c:30:10: fatal error: 'os/rand.c' file not found
#include "os/rand.c"
^
1 error generated.
error: command 'clang' failed with exit status 1
I have looked everywhere for information on this error and it has come up empty. Where does this dependency come from and how do I install it?
Thanks!
CrossMap depends on pysam which is a wrapper for sam tools. You need to install htslib before compiling pysam.
I have the following environment:
Linux Mint17.1 which comes pre-installed with python 2.7.6.
I setup an altinstall for python 3.3.5
Using python 3.3 I created a virtualenv
I am trying to install TA-Lib in the virtual env but am not having any success.
If I try to install with:
./easy_install TA-Lib
I get the following error:
Searching for TA-Lib
Reading https://pypi.python.org/simple/TA-Lib/
Reading http://github.com/mrjbq7/ta-lib
Reading https://github.com/mrjbq7/ta-lib/releases
Best match: TA-Lib 0.4.8
Downloading https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.zip
Processing TA_Lib-0.4.8.zip
Writing /tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/setup.cfg
Running ta-lib-TA_Lib-0.4.8/setup.py -q bdist_egg --dist-dir/tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/egg-dist-tmp-w24p9n
/tmp/easy_install-67a3vk/ta-lib-TA_Lib-0.4.8/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
talib/common.c:314:28: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
If I try to install with:
./pip install https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz
I get the following error:
Downloading/unpacking https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz
Downloading TA_Lib-0.4.8.tar.gz (unknown size): 544kB downloaded
Running setup.py (path:/tmp/pip-rxvyyh-build/setup.py) egg_info for package from https://github.com/mrjbq7/ta-lib/archive/TA_Lib-0.4.8.tar.gz
/tmp/pip-rxvyyh-build/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
Installing collected packages: TA-Lib
Running setup.py install for TA-Lib
...removed to make post shorter...
compilation terminated.
/tmp/pip-rxvyyh-build/setup.py:49: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
error: command 'gcc' failed with exit status 1
So basically both approaches result in a final error of:
command 'gcc' failed with exit status 1
I have no problem installing other packages such as numpy, pandas, matplotlib etc in the virtualenv. It is just TA-Lib that is not working.
You don't have installed underlying ta-lib library. You can find more info on the project site https://github.com/mrjbq7/ta-lib :
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.
Under Windows, it seems that easy_install with a C dependency isn't very easy.
Attempt 1 - vcvarsall.bat errors
I am installing cython under Windows7, with MinGw; I modified Windows7's PATH to include C:\MinGw\bin. At this point, I tried to easy_install -U cython, and got...
C:\Users\mike_pennington\Desktop\TestDrive>easy_install -U cython
Searching for cython
Reading http://pypi.python.org/simple/cython/
Reading http://www.cython.org
Reading http://cython.org
Best match: Cython 0.15.1
Downloading http://cython.org/release/Cython-0.15.1.zip
Processing Cython-0.15.1.zip
Running Cython-0.15.1\setup.py -q bdist_egg --dist-dir c:\users\mike_p~1\appdata
\local\temp\easy_install-qr1tet\Cython-0.15.1\egg-dist-tmp-556kzq
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching 'bugs.txt' under directory 'tests'
error: Setup script exited with error: Unable to find vcvarsall.bat
C:\Users\mike_pennington\Desktop\TestDrive>
Attempt 2 - Fix vcvarsall.bat errors
Next, following the advice of a blog I found, I also tried putting this in C:\Python27\Lib\distutils\distutils.cfg to fix the vcvarsall.bat error.
[build]
compiler=mingw32
This only helps marginally...
C:\Python27\Lib\DISTUT~1>easy_install -U cython
Searching for cython
Reading http://pypi.python.org/simple/cython/
Reading http://www.cython.org
Reading http://cython.org
Best match: Cython 0.15.1
Downloading http://cython.org/release/Cython-0.15.1.zip
Processing Cython-0.15.1.zip
Running Cython-0.15.1\setup.py -q bdist_egg --dist-dir c:\users\mike_p~1\appdata
\local\temp\easy_install-kfif_o\Cython-0.15.1\egg-dist-tmp-o1tbkp
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching 'bugs.txt' under directory 'tests'
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: Setup script exited with error: command 'gcc' failed with exit status 1
C:\Python27\Lib\DISTUT~1>
Caveat - No cygwin or precompiled binaries
I realize that I might be able to get this working under cygwin; however, I don't want cygwin dependencies on this library; I need native Windows7 output.
If possible, I would like to avoid precompiled Cython binaries because as the author says, they are "unsupported and for testing purposes only".
Question
How can I get cython to install via easy_install under Windows7 with MinGw?
After more some googling, I found guidance that recommended removing -mno-cygwin from C:\Python27\Lib\distutils\cygwinccompiler.py because of a distutils bug.
Removing -mno-cygwin from C:\Python27\Lib\distutils\cygwinccompiler.py got cython to compile.