No module named 'django'

7 years 5 months ago #943 by jdf
jdf created the topic: No module named 'django'
Добрый день

У меня FreeBsd 11
Python 3.4.5

Все сделал по инструкции
pip install -r requirements.txt     
Requirement already satisfied: Django>=1.8 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: Pillow>=2.9.0 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied: apscheduler>=3.3.0 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied: olefile in /usr/local/lib/python2.7/site-packages (from Pillow>=2.9.0->-r requirements.txt (line 2))
Requirement already satisfied: tzlocal>=1.2 in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Requirement already satisfied: funcsigs; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Requirement already satisfied: pytz in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Requirement already satisfied: setuptools>=0.7 in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Requirement already satisfied: futures; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from apscheduler>=3.3.0->-r requirements.txt (line 3))
Но почему то при инициализации выдает:
python3 manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named 'django'

Я пробовал уже разные Django подсовывать и сборки SOPDS разные. где ошибка никак не пойму (((

Please Войти or Create an account to join the conversation.

  • jdf
  • jdf's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
7 years 5 months ago - 7 years 5 months ago #944 by mitshel
mitshel replied the topic: No module named 'django'
Обратите внимание на свой лог - зависимости вы установили для Python2.
Попробуйте как и написано в инструкции набрать:
pip3 install -r requirements.txt
Last Edit: 7 years 5 months ago by mitshel.

Please Войти or Create an account to join the conversation.

  • mitshel
  • mitshel's Avatar
  • Offline
  • Администратор
  • Администратор
More
7 years 5 months ago #945 by jdf
jdf replied the topic: No module named 'django'
Пробовал =(
pip3 install -r requirements.txt
pip3: Command not found.

Please Войти or Create an account to join the conversation.

  • jdf
  • jdf's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
7 years 5 months ago #946 by jdf
jdf replied the topic: No module named 'django'
это я победил )
python3 -m ensurepip
но:
 python3 manage.py migrate
...
 File "/usr/local/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 28, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'

Пытаюсь поставить
pip3 install MySQl-python  
Collecting MySQl-python
  Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-odebgmim/MySQl-python/setup.py", line 13, in <module>
        from setup_posix import get_config
      File "/tmp/pip-build-odebgmim/MySQl-python/setup_posix.py", line 2, in <module>
        from ConfigParser import SafeConfigParser
    ImportError: No module named 'ConfigParser'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-odebgmim/MySQl-python/

Установка парсера не помогает
pip3 install configparser
Collecting configparser
  Downloading configparser-3.5.0.tar.gz
Installing collected packages: configparser
  Running setup.py install for configparser ... done
Successfully installed configparser-3.5.0

вот как то так (((

Please Войти or Create an account to join the conversation.

  • jdf
  • jdf's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
7 years 5 months ago #947 by jdf
jdf replied the topic: No module named 'django'
так тут я невнимательно инструкцию смотрел ))
pip3 install mysqlclient

Please Войти or Create an account to join the conversation.

  • jdf
  • jdf's Avatar Topic Author
  • Offline
  • Новый участник
  • Новый участник
More
7 years 5 months ago - 7 years 5 months ago #948 by zhuravel
zhuravel replied the topic: No module named 'django'
FreeBsd 10.3 . Я устанавливал так.
pkg install python2
pkg install python3

далее команда:
python3.4
>>> import ensurepip
>>> raise SystemExit

далее:
python3.4 -m ensurepip --upgrade
pip3 install --upgrade pip
pip3 install mysqlclient
После этого создавал БД
     mysql -uroot -p
     mysql > create database if not exists sopds default charset=utf8;  
     mysql > grant all on sopds.* to 'sopds'@'localhost' identified by 'sopds'; 
     mysql > exit
и согласно инструкции
python3 manage.py migrate
	python3 manage.py sopds_util clear
Last Edit: 7 years 5 months ago by zhuravel.

Please Войти or Create an account to join the conversation.

  • zhuravel
  • zhuravel's Avatar
  • Offline
  • Захожу иногда
  • Захожу иногда
More
Time to create page: 0.101 seconds