django-rest-auth installition error - django

im trying to install django -rest- auth with in my application in (venv)
pip install django-rest-auth
but i get this error. why?
note: ** django and djangorestframwork are already installed
pip install django-rest-auth
Collecting django-rest-auth
Using cached django-rest-auth-0.9.2.tar.gz
Requirement already satisfied: Django>=1.8.0 in ./venv/lib/python3.5/site-packages (from django-rest-auth)
Requirement already satisfied: djangorestframework>=3.1.0 in ./venv/lib/python3.5/site-packages (from django-rest-auth)
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.5/site-packages (from django-rest-auth)
Requirement already satisfied: pytz in ./venv/lib/python3.5/site-packages (from Django>=1.8.0->django-rest-auth)
Building wheels for collected packages: django-rest-auth
Running setup.py bdist_wheel for django-rest-auth ... error
Complete output from command /home/mohammadreza/PycharmProjects/mohammadrezaDjangoApp/Django/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xl9ds058/django-rest-auth/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp5sk4s13wpip-wheel- --python-tag cp35:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for django-rest-auth
Running setup.py clean for django-rest-auth
Failed to build django-rest-auth
Installing collected packages: django-rest-auth
Running setup.py install for django-rest-auth ... done
Successfully installed django-rest-auth-0.9.2

Simply install wheel package seems to fix the problem.
pip install wheel, then pip install django-rest-auth again.

Related

How shoud I fix ERROR with pip install psycopg2==2.7.*?

I am trying to put my app that I created on server www using heroku. But when I put to my terminal on Ubuntu pip install psycopg2==2.7.*, I get this error:
ERROR: Command errored out with exit status 1:
command: /home/marcin/Python/learning_log/ll_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c67buptz/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c67buptz/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-c67buptz/psycopg2/pip-egg-info
cwd: /tmp/pip-install-c67buptz/psycopg2/
Complete output (28 lines):
running egg_info
creating /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info
writing /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/command/egg_info.py:643: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
warnings.warn(
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.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
What should I do?
You need some dependencies check this answer
https://stackoverflow.com/a/46877364/15208727
sudo apt install libpq-dev python3-dev
You should install pscopg2-binary and the push to heroku
pip install psycopg2-binary or pipenv install psycopg2-binary depending on your virtualenv

Error while attempting to pip install psycopg2==2.7.*

I'm trying to run the package, pip install psycopg2==2.7.* ,on my PyCharm terminal so I can deploy my site but I get the message that appears below
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz
ERROR: Command errored out with exit status 1:
command: /Users/applecare/PycharmProjects/learning_log/11_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/psycopg2/
Complete output (23 lines):
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
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.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the '`pip install --upgrade pip`' command.
If you are on Linux, you will need to install PostgreSQL to run your database and then to connect the clients to your PostgreSQL database you will need other packages like libpq-dev, libpq5.
You can install the above packages with the below commands.
sudo apt-get install postgresql
sudo apt-get install libpq5
sudo apt-get install libpq-dev
So if you’re on Mac, I can think of two ways:
pip install psycopg2-binary
Install PostgreSQL with brew or the excellent postgre.app and point the path to pg_config binary (this is actually the error you’re getting)
On Mac I did brew install postgresql and it did the trick for me

I want to visualize the database diagram in django but problem in pygraphviz

I am trying to visualize the database diagram in django.
in Docker file I have:
RUN apt-get install -y python3-dev graphviz libgraphviz-dev
RUN apt-get install -y python-pygraphviz pkg-config
and in requirements.txt I have:
django, psycopg2, djangorestframework, PyJWT, gunicorn, channels, django-extensions, graphviz, cGraph, pygraphviz
but I get this error :
Building wheel for pygraphviz (setup.py): started
Building wheel for pygraphviz (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ...
----------------------------------------
ERROR: Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Successfully built cGraph
Failed to build pygraphviz ... ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
any idea about this error?
I think you have the wrong Package, try it with
docker-compose <-f local.yml> run --rm <containername> pip install graphviz
Or add it to your requirements:
graphviz==0.16 or 0.1*
Also change your Dockerfile RUN to:
RUN pip install -r /requirements/local.txt
dont call every single library.
Little late but hope that helps, Cheers.

error: invalid command 'bdist_wheel'

On a RHEL machine
I have some old Django projects that I'm moving to a new server, these were written for Python2.6, Django1.4.3
I've installed python2.7, created the virtualenvs in my home directory, adjusted paths and references to the Python version.
I created a virtualenv for Python2.7:
virtualenv -p python2.7 ~/.virtualenvs/my_site/
When I activate the virtualenv and then cd into the web site directory and run
pip install -r requirements.txt
after successfully fetching all the libs, the following error is displayed for every line in requirements.txt:
Building wheels for collected packages: MySQL-python, Pillow...etc
Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command /home/my_user/.virtualenvs/my_site/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-96k9a4/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ngSbQU --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
I've found many other similar questions on stackexchange and other sites, and tried the fixes but no luck!
Why can I not create a wheel in python?
Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI?
Can't build wheel - error: invalid command 'bdist_wheel'
I have pip 10.0.1
wheel IS installed (through pip install wheel), I've also run the following in my virtual env:
pip install --upgrade pip ('Requirement already up-to-date')
pip install setuptools --upgrade ('Requirement already up-to-date')
python setup.py bdist_wheel ('error: invalid command 'bdist_wheel'')
What else can I look at to fix this?
Not sure why, but uninstalling wheel fixed it
I uninstalled wheel with a view to reinstalling it, but it worked without reinstalling.
pip uninstall wheel

Installing scrapy in Lubuntu using pip install scrapy (or sudo ) and getting the following error

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nExfhn/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-dpob_w-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-nExfhn/cryptography/
So I have tried :
1) pip install scrapy (with pip 9.0.1 so no need to update)
2) sudo pip install scrapy (still getting the same error)
I have setup the scrapy framework in Windows environment but in Linux seems different and I also get this Cryptography error.