I am trying to install channels, following their tutorial(channels tutorial) but when I try to run the server I get the error: No module named 'channels'.
I have tried reinstalling it, moving the app to the top of the list of "INSTALLED_APPS" but it still does not work.
I have installed python 3.7 and django 2.1.3
There is no need to reinstall the python Or django. You just forgot to install channels. Follow Channel 2.1.7 installation
Try python -m pip install -U channels
this will fix your issue.
It seems the problem was it conflicted with another library, probably whitenoise. I created a new clear env and it works fine now.
I have also getting this issue:
you need to run python -m pip install -U channels. This might solve the issue.
Related
I have created python 3.5.2 virtual environment ("python --version" confirms that)
but when i try to install django using "pip install django~=1.10.0" I get this message:
Requirement already satisfied: django~=1.10.0 in /usr/local/lib/python2.7/dist-packages
How can I get django version that agrees with the python version in my venv?
Personally I use conda to manage environments and I'm not really familiar with virtualenv, but a few things to check.
I bet you need to use pip3 not pip (aka pip2) to install django that way it will be installed in your python 3 env.
Probabily you have already installed django outside the venv with python2.
just write see in the pip list if django is installed.
Then uninstall, enter in the venv and reinstall django with python3
Ok - so I figured out what happened. I have installed django using sudo pip install. Even though I was in the venv (created with python3) this has resulted in reference to django outside the venv. Sooo...it was an interesting thing to learn I guess.
I'm trying to install Django using pip on my windows machine, however i keep getting an error in command prompt:
Fatal error in launcher: Unable to create process using '"'
I've been searching around on the internet for solutions, but I cant seem to find any.
Thanks in advance
Make sure you have a virtual env setup. Then activate it and try installing django.
Try use the python installation from Active State http://www.activestate.com/activepython/downloads
I'm a Linux User but I've used python and Django on Windows with ActiveState.
When you install it, the installation create a folder with any utils tools, like pip, easy_install and etc... And the pip of this script works well
Have you tried
python -m pip install django
as advised here
I've gone through many threads related to installing mysql-python in a virtualenv, including those specific to users of Percona. None have solved my problem thus far.
With Percona, it is normal to get a long error on pip install MySQL-python in the virtualenv that ultimately says EnvironmentError: mysql_config not found. One method to remedy this is yum install mysql-devel, which I've done. I can actually get mysql-python to install properly outside of the virtualenv via yum.
I'm getting the error in the virtualenv only - it uses Python 2.7.9, wheareas 2.6.6 is what comes with Centos.
Also, with MySQL-python installed via yum it will import to the OS's python interpreter, but will not import into the virtualenv's python interpreter.
To clarify, I only installed mysql-python via yum to see whether or not it would work that way. I would prefer it be by pip, in the environment only.
What am I missing here? As far as I'm aware it should work - considering it will work outside of virtualenv.
Found the solution!
I think it was improper of my to install mysql-devel in the first place, so I went ahead and uninstalled it.
Instead, I used a packaged supplied by Percona - Percona-Server-devel-55
yum install Percona-Server-devel-55 and the problem is solved!
I had an old version of django-bouncer that required hashcompat, which is now deprecated. Since I was getting errors telling me this, I did pip uninstall django-bouncer, then installed the version upgraded for Django 1.6 (it uses hashlib instead of hashcompat) using pip install https://github.com/shelfworthy/django-bouncer/archive/master.tar.gz (I also re-added it to my requirements.txt file).
Locally, this is working fine. However, when I push to Heroku, I'm still getting the error "No module named hashcompat."
I tried doing a git push heroku master --force, but that didn't resolve the problem. Then I reset the app by doing heroku repo:reset -a <myappname>, followed by did a new git push heroku master. Unfortunately, I'm still getting the error on my Heroku app.
How can I make Heroku get the upgrade of django-bouncer?
What you should do is this:
Firstly, install django-bouncer's latest release locally on your laptop (you can do this by running pip install -U django-bouncer.
Next, figure out what the latest version is on your laptop, by running: pip freeze | grep django-bouncer. You should see something like: django-bouncer==x.x.x.
Lastly, edit your project's requirements.txt file and add django-bouncer=x.x.x, then push this change to Heroku. This will force Heroku to detect what specific version of django-bouncer is required, and install it for you.
Hope that helps!
It's possible you are running afoul of Heroku's package cache; it sees django-bouncer is already installed and doesn't bother to install it again. But, you can't uninstall it either.
I recall there's a bit of a hack to get around this: Heroku will wipe out its package cache if you change the version of Python you are using. So if you are using, say, 2.7.6, edit your runtime.txt to change it to python-3.4.0. If you are already using a 3.x branch, do the opposite. It's not important that your application actually works on the version you're changing it to -- deploy once, and change it back. That should wipe out your package cache entirely, at which point you'll be good to go.
Whenever I try to pip install anything in my virtualenvs I am told it is Downloading/Unpacking. My terminal then stays on that line indefinitely. The longest I have left this running was 2 hours (trying to install iPython) without success.
Most recently, I tried installing django in one virtualenv using pip. Once it said Downloading/Unpacking I created another virtualenv in another terminal window and used easy-install to install django and mezzanine. Both installed with their dependencies before there was any movement on the terminal using pip. I left the pip window running for an hour before giving up. I have tried pip install, pip install -v --use-mirrors and their sudo equivalents without much change in the results (-v --use-mirrors spews out a list of urls before stalling at Downloading/Unpacking).
I am using Python 2.7 on Ubuntu 12.04.1 64-bit. I use Virtuanlenvwrapper to create and manage my virtualenvs, if that helps.
I can't find any references to other people having this problem so I expect it's a mistake of mine. Does anyone have any idea what I'm doing wrong?
Following #HugoTavares's suggestion I found I needed to install python-dev. I don't know why this helped but it seems to have solved this particular problem. I'm putting this answer on for now but Hugo, if you read this, please post an identical one and I'll remove acceptance on this and accept yours, since you deserve the credit.