We install virtualenv inside every project in server:
virtualenv env
source env/bin/activate
pip install -r requirements.txt
But I have stil from django.utils.six import with_metaclass ImportError: No module named six
error in syncdb. I have this problem with django-modeltranslation.
Why I have this error? I could import six in python.
Django 1.4 is a very old version. django-modeltranslation clearly relies on a more recent version of Django.
Related
Hi im trying to run a venv for my project. Everythin goes well install requirments and creating a my venv. The problem is that when i try to make a manage.py migrate i get this error. Ive looked everywhere and i got python version 3.8 installed. Pathlib is part of the package from python 3.4.
I use Windows and python 3.8 with Django version 3.0.12- My project is based on a cockiecutter and i dont want to update to the latest version om django.
Does anone know what the problem is and how it can be solved?
manage.py migrate
Traceback (most recent call last):
File "E:\Dev\Fooders\fooders\manage.py", line 4, in <module>
from pathlib import Path
ImportError: No module named pathlib
Try:
python manage.py migrate
# or if it does not work
python3 manage.py migrate
I get this error whenever I run my code:
File "...", line 6, in <module> from django.urls import reverse
ImportError: No module named urls
So I look at that file and check the line and it says that this has an error:
from django.urls import reverse
I don't know where the error is coming from because when I delete the line of code, it returns me this error:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
I also tried adding MySQLdb in the interpreter but this time, it gives me this error:
Non-zero exit code (1)
please confirm the from django.conf.urls import include, url is added in your header or not.
For MySQl error, you may need to install the Python and MySQL.
sudo apt-get install python-dev default-libmysqlclient-dev #Ubuntu
Then install the mysql client using pip command.
pip install mysqlclient # for python 2.x
pip3 install mysqlclient # for python 3.x
Finally
pip install PyMySQL #for python 2.x
pip3 install PyMySQL #for python 3.x
When i am trying run a python script with following code
from robobrowser import RoboBrowser
I have got following error:
from robobrowser import RoboBrowser
ImportError: No module named robobrowser
This usually happens when the library was not installed correctly, make sure you have installed it.
Python robobrowser 0.5.3
It's easy to install, go to your terminal and type easy_install robobrowser or if you have installed pip then you can also install by doing pip install robobrowser
Requirements: python >= 2.6
I was trying to install the django_quiz app that was found on github.
https://github.com/tomwalker/django_quiz
And as you can see below, i've installed all requirements. but there's no manage.py. How do i start and run the project?
Things I did >
Cloned the repo with git clone https://github.com/tomwalker/django_quiz.git.
Run --> pip install -r requirements.txt.
Run --> python setup.py install
Added 'quiz', 'multichoice', 'true_false', 'essay' to INSTALLED_APPS setting.
Added url(r'^q/', include('quiz.urls')), to urls.py.
NB: I'm a beginner in Django. Please help me. I'm kind of stuck here.
Django Version : 1.6.5
Installed c:\python27\lib\site-packages\django_quiz_app-0.5.1-py2.7.egg
Processing dependencies for django-quiz-app==0.5.1
Searching for Pillow==2.5.0
Best match: Pillow 2.5.0
Adding Pillow 2.5.0 to easy-install.pth file
Using c:\python27\lib\site-packages
Searching for Django==1.6.5
Best match: Django 1.6.5
Adding Django 1.6.5 to easy-install.pth file
Using c:\python27\lib\site-packages
Searching for django-model-utils==2.0.3
Best match: django-model-utils 2.0.3
Adding django-model-utils 2.0.3 to easy-install.pth file
Using c:\python27\lib\site-packages
Finished processing dependencies for django-quiz-app==0.5.1
C:\Users\Vaisakhan\django_quiz>python manage.py runserver
python: can't open file 'manage.py': [Errno 2] No such file or directory
I think this repo misses some steps. I think the steps should be as follows:
pip install virtualenv (you can skip this step and the next one if you are sure that there will not be any dependency error.)
virtualenv ~/quiz_env
source ~/quiz_env/bin/activate
pip install Django==1.6.5
django-admin startproject quiz_project
navigate to quiz_project/quiz_project, edit setting files
navigate to quiz_project/ and copy all the apps directory ('quiz', 'multichoice',....etc) inside quiz_project along with requirement.txt file
pip install -r requirements.txt
python manage.py syncdb
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
Create a manage.py file and store it in the top folder of your file structure. Replace mysite with the folder holding your django quiz code.
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
I upgraded to Django to 1.8.3, and i hit this error:
from django_nose.runner import *
File "/blah/lib/python2.7/site-packages/django_nose/runner.py", line 22, in <module>
from django.db.backends.creation import BaseDatabaseCreation
ImportError: No module named creation
I looked around for solutions, but could not find any. Is there a way to fix this issue ?
Fyi, i did a
pip install django==1.8.3
Any help would be appreciated.
Maybe upgrading django_nose will work (version 1.4 has Django 1.8 support according to the changelog)
pip install django_nose --upgrade
Change:
from django.db.backends.creation import BaseDatabaseCreation
To:
from django.db.backends.base.creation import BaseDatabaseCreation