0

Like the title says, I install crispy forms and it's installed, but when I try to migrate, it says crispy forms it's not installed

(env) C:\Users\Dias\Desktop\Soccer_site\aposta_segura>pip3 install django-crispy-forms
Requirement already satisfied: django-crispy-forms in c:\users\dias\desktop\soccer_site\aposta_segura\env\lib\site-packages (1.9.0)

(env) C:\Users\Dias\Desktop\Soccer_site\aposta_segura>python3 manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\Dias\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\core\management\__init__.py", lin
e 401, in execute_from_command_line
    utility.execute()
  File "C:\Users\Dias\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\core\management\__init__.py", lin
e 377, in execute
    django.setup()
  File "C:\Users\Dias\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Dias\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\apps\registry.py", line 91, in po
pulate
    app_config = AppConfig.create(entry)
  File "C:\Users\Dias\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\django\apps\config.py", line 90, in crea
te
    module = import_module(entry)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy_forms'

(env) C:\Users\Dias\Desktop\Soccer_site\aposta_segura>

If I install using the requirements.txt, the same thing happens, it says all the requirements are installed but crispy forms is not, i tried using "--user" but it doesn't work, don't know if it's a windows thing

João Dias
  • 135
  • 8
  • 1
    You have already activated your virtual env, you should probably use `python manage.py migrate`. `python3` is not resolving to the python interpreter in your virtual env. You can test this by running `where python3` and `where python`, the result that is located within your virtual env is the correct one to use – Iain Shelvington Apr 22 '20 at 02:43
  • Thye both appear in the same directory `C:\Users\Dias>where python C:\Users\Dias\AppData\Local\Microsoft\WindowsApps\python.exe C:\Users\Dias>where python3 C:\Users\Dias\AppData\Local\Microsoft\WindowsApps\python3.exe` using just python worked, will I have any sort of problems though,since I'm using an "older version"? – João Dias Apr 22 '20 at 09:19
  • `python worked` this means that `python` is configured for your venv. `will I have any sort of problems though,since I'm using an "older version"?` this depends on what you are trying to do. You can always set a venv for python3 see [here](https://stackoverflow.com/questions/23842713/using-python-3-in-virtualenv) – AzyCrw4282 Apr 22 '20 at 09:45

1 Answers1

2

As @lain mentioned, it seems that the Requirement is already satisfied in your venv. This could only mean that the interpreter cannot be resolved to the correct venv.

check this in cmd prompt

where python 

And

where python3

The output of the first will match to the same directory as your venv.

Most likely its python so just use python manage.py migrate and it should work.

AzyCrw4282
  • 7,222
  • 5
  • 19
  • 35