hi can help me in this issu wth database whith django - django

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
how can resolv this issue .im alrady install psycopg2 in my vertualenv

activate your env and do a pip install
cd /path/to/virtualenv
source name-of-vitualenv/bin/activate
pip3 install psycopg2

Related

ModuleNotFoundError: No module named 'PIL' , A problem came when I run my Django Project

When I try to run my Django project, it came an error:'ModuleNotFoundError: No module named 'PIL''. I try install Pillow in my virtual environment, but it still can't work.
enter image description here
You can install package by :
pip install pillow

Django Heroku - ModuleNotFoundError: No module named 'django_heroku'

I am deploying on heroku a website but I am experiencing some issue.
My project is called mysite-project.
I did the following:
1) Create a Procfile containing:
web: gunicorn mysite-project.wsgi
at the base root of my project (same level where manage.py is).
2) app/settings.py
import django_heroku at the top
django_heroku.settings(locals()) at the bottom of settings.py
3)
pip install gunicorn
pip install django-heroku
pip freeze > requirements.txt
4) If I run python manage.py runserver I get:
ModuleNotFoundError: No module named 'django_heroku'
There was a problem with:
pip install django-heroku
It was not fully installed because thee was a problem with psycopg2 that was not installed.
To install psycopg2, run:
pip install psycopg2
Then you can run pip install django-heroku and the error disappeared
I had the same problem as well. I have psycopg2 installed. (for postgres)
Installing 'psycopg2- binary' solved my problem.
For me, the error was due to adding django-heroku to installed apps in settings.py..,removing it solved the issue.

Flask module cannot be found in pyvenv although it is installed

I used the following commands to create the virtual environment and run my code:
mkdir ~/.virtualenvs
pyvenv ~/.virtualenvs/bitirme
source ~/.virtualenvs/bitirme/bin/activate
pip3 install flask
pip3 install httpie
python3 server.py
Although flask is installed correctly I still get the error that flask module cannot be found. What am I doing wrong here?
Try to do this in the normal way (i guess, that you on *NIX):
Install "virtualenv" module via pip
Go to the directory, where you wanna create virtual environment
Type in terminal "virtualenv %name% %python_path%"
Now to activate, do "./%name%/bin/activate"
Install "pip install flask httpie"
Run "python server.py"
NOTE:
If you created virtual environment with your "python 3"
installation, you should not add "3" to python, or pip

django installation not working virtualenv

I have installed virtualenv
pip3 install virtualenv
create a virtualenv
virtualenv djangoenv
access the virtualenv
source ./djangoenv/bin/activate
Then I install
pip3 install django
when import django I get errorno module named django
django-admin.py --version displalys 1.9.4 So it is installed. what am I doing wrong ??
Install virtualenv with pip :
sudo pip install virtualenv
create Virtualenv
virtualenv -p /usr/local/bin/python3 virtualenv_name
activte Virtualenv
source virtualenv_name/bin/activate
finally install django
pip install django
With that you will get django installed using python3

: Error loading MySQLdb module: No module named MySQLdb

django.core.exceptions.ImproperlyConfigured:
Error loading MySQLdb module: No module named MySQLdb
Tell me the solution where I can change the code
You need to install MySQL-python. It can be done, for example, using pip:
pip install MySQL-python
Also, you'll need some libs to be able to install it. In Debian linux it can be done by following command:
sudo apt-get install build-essential python-dev libmysqlclient-dev
Use pip install mysqlclient. For me, pip install MySQL-python doesn't always work on my Windows.
Reference: Official documentation on MySQL DB API drivers