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
Related
I am trying to install psycopg2-binary into my Django project. I am using a virtual environment and the command I'm running is
pip install psycopg2-binary
However, I'm getting a massive error message, the gist of it is this:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. 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'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
But, hey, I'm installing exactly 'psycopg2-binary'
Why am I getting all this mess?
Pip cannot find you processor+OS at https://pypi.org/project/psycopg2-binary/2.9.2/#files so it tried to install from sources (the last file at the page) and failed.
Compiling from sources is currently the only way. If you can donate some spare processor cycles to the Psycopg2 authors they perhaps could start compiling and publishing wheels for OSX on M1.
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
I've installed flask, flask_login, and ldap in the virtualenv for my flask package (to authenticate ldap users with the usernames & passwords of the other users at my company).
When I run my flask app, I get "AttributeError: 'module' object has no attribute 'initialize'"
I'm tried "pip install python-ldap"
but I get a red error (sandwiched between other white text) that reads:
"Failed building wheel for python-ldap"
I have thoroughly examined these:
How to install python-ldap on a python 2.7 virtualenv on windows without compiling
Installing python-ldap in a virtualenv on Windows
https://www.python-ldap.org/docs.html
https://www.linuxjournal.com/article/6988?page=0,1
to no avail.
I've had this error for days now...
(also:
pip install openldap
gives:
Collecting openldap
Could not find a version that satisfies the requirement openldap (from versions: )
No matching distribution found for openldap
...(in and outside of my venv) if that information helps)
I had this error last week and after switching work computers, I recreated the virtualenv and installed all of the other packages and dependencies successfully.
my requirements.txt file contains these lines after a line of git stuff:
click==6.7
Flask==0.12.2
Flask-Login==0.4.0
itsdangerous==0.24
Jinja2==2.9.6
ldap==1.0.2
ldap3==2.2.4
MarkupSafe==1.0
pyasn1==0.2.3
Werkzeug==0.12.2
Has anyone successfully installed python-ldap into a flask virtualenv with windows? If so... how?!
Go to:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
download python_ldap-2.4.38-cp27-cp27m-win_amd64.whl in the same directory that your venv folder is listed under
(ex.)
/myrepo
/myapp
/myapp
/venv
/run.py
/python_ldap-2.4.38-cp27-cp27m-win_amd64.whl
install the .whl file while inside of your venv
venv\Scripts\activate
pip install python_ldap-2.4.38-cp27-cp27m-win_amd64.whl
Voila!
The error
ERROR: Failed building wheel for python-ldap
can occur for several reasons. You actually have to look at what happened above this line. In my case, I just had to install missing dependencies to build python-ldap. You can look them up here. For CentOS 8, I had to install:
sudo dnf install openldap-devel python3-devel gcc
to make
python3 -m pip install --user python-ldap -U
work.
I tried to install Django-toolbelt, but I keep getting the below. I am using Mac. I've tried googling around for solutions but no luck. Thanks.
(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ pip install django-toolbelt
/Users/chantrinh/Django_app2/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting django-toolbelt
Using cached django-toolbelt-0.0.1.tar.gz
Collecting django (from django-toolbelt)
Using cached Django-1.8.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-toolbelt)
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 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'
warning: manifest_maker: standard file '-c' not found
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'.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/4r/bh8wxz5d2678zg90jn1715s80000gn/T/pip-build-eUKfh5/psycopg2
(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ pg_config
-bash: pg_config: command not found
(venv)Chans-MacBook-Pro:Django_app2 chantrinh$ sudo find / -name pg_config
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
I had exactly the same error message. However, in my case, I had already installed psycopg2. What was happening was the following:
I had first to install Macports,
Then in the python documentation I got this line:
sudo port install py27-psycopg2
But that line installed the package in
'/opt/local/Library/Frameworks/Python.Framework/....'
instead of
'/Library/Frameworks/Python.Framework/....'
I just created a symbolic link to solve the problem.
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.