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
Related
please could any one help!
Trying to import matplotlib I get this ImportError: *cannot import name 'artist' from 'matplotlib'*.
I removed the package (*py -m pip uninstall matplotlib*) and reinstall it but I still get the same error.
Thanks!
One of the common reasons why Python packages cannot be imported is because of its virtual environments. Basically when you install a package manager, it creates some root environment for you and you by default install all packages there. Now this issue may arise if you download a package into another VE, then in your code editor you should pick the one where it lies. I recommend you to check if your package is installed and pick that environment in the IDE, however from what I know it generates a different error message, something like the import couldn't be resolved. Did it help you?
I just installed "Pandas" in python using "pip install pandas" but it keeps posting a error about another module called "ctypes".
Error:
I have no idea what to do.
Unless I don't understand your question correctly, you need to run your application through a virtual env. if you are using conda, conda activate ./your-venv, if pip, your-venv\Scripts\activate
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.
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!
I have been trying to install tweepy on OSx via
pip install tweepy
I have already installed pip, but I am getting this strange error message I haven't come accross before and, obviously Tweepy doesn't import at all (because it hasn't installed).
I get the following error message:
error: could not create '/Library/Python/2.7/site-packages/tests': Permission denied
Is there any way that I can grant permission? What am I doing wrong?
Thanks in advance
Extra information: running Python 2.7 if you couldn't tell from the path
As mentioned by Alko, you need root access to write to the directory where pip stores the packages.
You can type:
sudo su
in the terminal and then type:
pip install tweepy
Alternatively, you can use virtualenv:
"What if you can't install packages into the global site-packages directory? For instance, on a shared host.
In all these cases, virtualenv can help you. It creates an environment that has its own installation directories, that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed libraries either)."
Basically, it will allow you to create isolated environments for each of your python projects and will allow you to sidestep the permissions issue you are having.
For a good explanation see: Installing Python on Mac OS X: virtualenv