No module named 'captcha.fields' - python

Hi~I have got a ModuleNotFoundError saying "No module named 'captcha.fields'" when I run manage.py in my Django project.
I confirm that django-simple-captcha has been installed and successfully imported into my programme. But I check the captcha package and I haven't found any definition for captcha.fields.
Could anyone help me, please? Thank you.

pip install django-recaptcha
use this to install package in your python environment

Simply uninstall the package from your virtual environment and reinstall it. Do migrate if need be. The issue should be solved.

Related

how i can i solve no module named can error?

hello i'm using python 3 and ros noetic, and i got this error
import can
ImportError: No module named can
I've got this error before, and I solved it through a very simple can-bus related installation command in google. But I can't find that command now
I've tried all the like $ sudo apt install python3-can.
but I can't fix it at all
thank you................
The problem is, that the module can't be found by your python.
first, try to remove the package with:
pip uninstall python-can
and re-install it with
pip install python-can
In case you have several versions of python installed (such as python2 and python3) make sure, you use
pip3
instead of pip.
Next you can try to manually search your package directories for the package, if it is even there.
Try cloning the library with git and running the setup.py installation, worked for me.

I have an error when installing the SpeechRecognition

pip install SpeechRecognition
I try to install SpeechRecognition with the command above but i get this message:
from http import cookies
ImportError: cannot import name 'cookies' from partially initialized module 'http' (most likely due to a circular import) (C:\Users\52644\venv\Lib\site-packages\django\http\__init__.py)
Can someone help me with this please.
I already solved it, in the directory variables I had one that I created that was named PYTHONPATH, you donĀ“t have to do that because python does that automatically, so you would have literally kind of a copy of all the files, that was producing the error. So, i just deleted that variable and it worked. Thanks fo the ones that answered.
While working with a large framework as Django one must always work in a virtual environment. Please check if you have your virtual environment activated. If not, then follow the steps:
cd your_working_directory
virtualenv environment_name where environment_name can be any name you want.
environment_name/Scripts/activate if on Windows
Or environment_name/bin/activate if on MacOS
Then after activating the environment you can install all the dependencies using pip. i.e pip install django or pip install SpeechRecognition

ImportError: No module named rest_framework_extensions.cache.mixins

Trying to set up RDMO on a apache server, but when running "python manage.py runserver" this error accures. Before that many other import Error accurred which I solved by pip install missing package, but i am not able to find requred package to solve this error.
And it would also be very helpful if someone can provide name to the whole package/bundle required for RDMO server run.
It looks like you need to install drf-extensions package
you need to do,
pip install drf-extensions
its because of drf-extensions missing.. install it will fix

Virtualenv installed package not found

I installed a django-secure into a virtualenv using pip. The install was normal. The module shows up in the virtualenv pip list and in virtualenvs/dev/lib/python2.7/site-packages. I get the following error when running my code.
ImportError: No module named djangosecure
The folder is in there and there is an init. No install issues. What am I doing wrong and how do I fix it?
Make sure your wsgi file points to the right virtualenv!

python path for setting Django app

Believe me or not but after searching the web for half an hour I couldn't find the answer:
How to install django app (ex. django-profile) to the specific python path?
The problem is I installed it with pip but it was installed on the "global" path. I don't want it. I want it to be installed in /home/usr/Dev/lib folder where my project lives.
Could you help me? Am I missing something?
Thank you!
From the author of pip himself:
Install a Python package into a different directory using pip?
PREFIX_PATH=/path/to/folder
pip install --install-option="--prefix=$PREFIX_PATH" django-profile
This would install django-profile in /path/to/folder/lib/pythonX/site-packages
With virtualenv you can customize where the django apps and python packages are installed.

Categories

Resources