我已经在我的virtualenv上安装了django-star-ratings 0.7.0,并且还在setting.py的INSTALLED_APPS
中添加了“ star-ratings”,但是仍然出现此错误:
ModuleNotFoundError:没有名为“ star_ratings”的模块
(paktour) PS D:\Django2\dev\paktour\src\myApp> pip list
Package Version
------------------------ -----------
Babel 2.6.0
closure 20180204
Django 2.2
django-braces 1.13.0
django-crispy-forms 1.7.2
django-formset-js 0.5.0
django-generic-ratings 0.7
django-jquery 3.1.0
django-jquery-js 3.1.1
django-model-utils 3.1.2
django-multi-form-view 2.0.1
django-multiselectfield 0.1.8
django-phonenumber-field 2.2.0
django-star-ratings 0.7.0
django-tags-input 4.4.2
mysql-connector-python 8.0.15
mysqlclient 1.4.2.post1
phonenumbers 8.10.8
Pillow 5.4.1
pip 19.0.3
protobuf 3.7.1
PyMySQL 0.9.3
pytz 2018.9
setuptools 40.8.0
six 1.12.0
sqlparse 0.3.0
swapper 1.1.0
wheel 0.33.1
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'star_ratings',
'paktour',
]
答案 0 :(得分:3)
Python模块名称不能包含破折号-通常,它们会被下划线替换。
如果您查看installation instructions,他们会说要添加star_ratings
,而不是star-ratings
。