Error when install psycopg2 on mac - django

When i try to install psycopg2 on mac using pip install -r requirements.txt
I got error.
Collecting psycopg2==2.6 (from -r requirements.txt (line 30))
Using cached psycopg2-2.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: could not determine PostgreSQL version from '10.1'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/r6/0rwq93rx6n59lbn8jrng11gm0000gn/T/pip-build-hat1f3jy/psycopg2/
I could not solve it.python3.4.3 mac10.12
could anyone suggest any solution?

The issue you are running into here is that psycopg2 isn't compatible with Postgres 10 unless you use version 2.7 or higher.
So either you will need to install an earlier version of postgres or port whichever package you are trying to install to psycopg2 2.7.x
The relevant issue that was resolved in version 2.7 can be found here
https://github.com/psycopg/psycopg2/issues/489

Related

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-YYFUnW/psycopg2/

I'm trying to install requirements.txt file in python 2.7 in ubuntu but i get ERROR:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-YYFUnW/psycopg2/
What exactly does that mean, and how do I fix it? I already tried these commands:
apt-get install python-bs4
sudo install --upgrade setuptools
sudo apt-get update
Error Image :
This error can occur because of the version of psycopg2==2.6.2 you are trying to install. I did face this error while installing this version of psycopg2. So to avoid this error, you can use another version of it or the latest version as:
pip install psycopg2
Also, psycopg2 is going to be renamed from release of version 2.8, so it is recommended to install it using:
pip install psycopg2-binary
If you are installing psycopg2 from a requirements.txt file, you can comment out the package listed in the file as:
# psycopg2==2.6.2
Then install the package as suggested above, then install other requirements from the file with the package name still commented.

Command "python setup.py egg_info" failed with error code 1 in PATH/psycopg2

I needed to upgrade PostgreSQL from version 9.5 to version 11. After that, when I recreated my virtualEnv from a 'requirements.txt' file, I started giving the following error when installing the psycopg2 package:
Collecting psycopg2 == 2.6.2 (from -r conf/requirements.txt (line 50))
  Using cached https://files.pythonhosted.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    Error: could not determine PostgreSQL version from '11 .1 '
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-0Q7bhV/psycopg2/
After some research, I ran the following commands to try to solve, but it did not work:
sudo apt-get install postgresql-server-dev-all
sudo apt-get install postgresql-common
Finally, I noticed that version 2.6.2 of psycopg2 only supports version 9.5 of postgresql. For 11 you should use the latest version of psycopg2, that is, version 2.7.7. After you change the requirements.txt file, and the virtualEnv has been recreated correctly.
I hope it will be useful to others.
Go for this Command Python3 - sudo apt install libpq-dev python3-dev

dlib is not installing in pythonanywhere virtualenv

I am trying to recognize faces in an image using "face_recognition" library,to use it we have to install dlib but when installing dlib in pythonanywhere virtualenv console it is throwing some errors
below is the error I got during installation of dlib
(env) 16:09 ~/dlib (master)$ python setup.py install --yes
USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
running install
running bdist_egg
running egg_info
creating dlib.egg-info
writing dlib.egg-info/PKG-INFO
writing top-level names to dlib.egg-info/top_level.txt
writing dependency_links to dlib.egg-info/dependency_links.txt
writing manifest file 'dlib.egg-info/SOURCES.txt'
package init file 'dlib/__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'dlib.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
error: [Errno 38] Function not implemented
It looks like there's some strange problem with the current version of dlib that's stopping it from installing on PythonAnywhere. Version 19.3.1 seems to work:
pip2.7 install --user dlib==19.3.1
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
Try installing from this cmd command, assuming that you have already added pip in path

python pip install error language_check

When I am trying to install sudo pip install language_check
I got this error:
Collecting language_check
Downloading language-check-1.0.tar.gz
Complete output from command python setup.py egg_info: zip_safe flag not set; analyzing archive contents...
Installed /tmp/pip-build-_cYgOq/language-check/.eggs/3to2-1.1.1-py2.7.‌​
egg error in language-check setup command: package_data must be a dictionary
mapping package names to lists of wildcard patterns
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_cYgOq/language-check/
It's a bug in language-check. They fixed it at 23 March but didn't include in any release yet (release 1.0 was from 21 March).
Download the sources from Github and install with
python setup.py install
I believe that if you install the latest version of Python, python3.6.2 it should work.
git clone -b patch-1 https://github.com/SpartorA/language-check.git
python setup.py install
Above will work
I was able to successfully install language-check in my Python 3.7 environment on MacOS as follows:
Check Java installation :
for language-check, Java 8 is expected
For MacOS: Follow these steps : https://stackoverflow.com/a/24657630
Install language-check
pip install language-check, won't directly work, you would have to:
Install from a forked & fixed repo for language-check
pip install git+https://github.com/MCFreddie777/language-check.git

Install psycopg2 on Synology

I try to install psycopg2 on my DS2413+ (DSM 4.3). I've installed Python 2.7 with ipkg and pip. When I do :
/opt/local/bin/pip2.7 install psycopg2
I got the following error :
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
But I didn't found pg_config in my /usr/syno/ where a built in version of pgsql is already installed.
In other topics with this kind of error, they recommend to install python-dev, but I can't manage to install it on my NAS ... There is also a py26-psycopg2 ikpg but I need to install it on Python 2.7.
If anyone has a solution to these problem please tell me :')
Cheers
You don't need to install psycopg2, it is already installed in the site-packages if you used the official Synology python package, see
/usr/local/packages/#appstore/Python/usr/local/lib/python2.7/site-packages/
Also, using pip from ipkg may mess up your python install as there should really be one python2.7 installation.