17👍
It’s a question asked a year ago? I come here by Google.
I notice that the asker is Chinese, same as me.
So, maybe we face the same problem.
Oh, sorry for my bad English!
I HAVE FOUND THE RIGHT ANSWER!
It is because when Python installs some packages, it will check the Windows Registry, some Chinese software like Aliwangwang import ‘gbk’ value to the HKEY_CLASSES_ROOT. So Python doesn’t work.
It can be solved like this:
open C:\Python27\Lib\ mimetypes.py with Notepad ++ or other editor, then search the line ” default_encoding = sys.getdefaultencoding()”.
add codes to the line above like this:
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
default_encoding = sys.getdefaultencoding()
16👍
Try installing first libevent-devel and python-devel
yum install libevent-devel python-devel
and then installing
pip install uwsgi
4👍
I had the same problem. In my case, on top of the above suggestions I had to run:
sudo apt-get install build-essential
- How to generate presigned S3 urls using django-storages?
- Programmatically sync the db in Django
- Satchmo clonesatchmo.py ImportError: cannot import name execute_manager
- Retrieve queue length with Celery (RabbitMQ, Django)
- Add method imports to shell_plus
0👍
hugleecool’s solution is good. Another way to solve this is to find Control Panel and change the system’s non Unicode program’s language.
For Chinese system, i think the default value is Chinese, you could change it to English and it will solve all the similar decode problems.
- How to make trailing slash optional in django
- Using urls names in views
- Django get display name choices