(5).
查看第三方库(包)安装位置打开电脑命令窗口输入如:pip show times;
(6).
安装包失败pycharm第三方库(包)
解决方案:
pycharm设置里projecinterpret中[Manage Repostories]添加:
- 清华:https://pypi.tuna.tsinghua.edu.cn/simple
- 阿里云:http://mirrors.aliyun.com/pypi/simple/
- 中国科技大学 :https://pypi.mirrors.ustc.edu.cn/simple/
- 豆瓣:http://pypi.douban.com/simple/;
(7).
在电脑命令窗口输入:python3 manage.py runserver 8000(自己定义)才能启动django;(pycharm终端可以输入:python manage.py runserver 8000(自己定义)启动)
(8).
ModuleNotFoundError: No module named ‘mysql’
解决方案 :
pycharm安装相应的第三方库(包mysql)
(9).
1045 (28000): Access denied for user ‘root’@‘localhost’ (using
password: YES)
解决方案:
把环境变量[path]MySQL数据库填写的安装路径与MySQL安装位置得一致;
(10).
‘cryptography’ package is required for sha256_password or
caching_sha2_password auth methods
解决方案:
pycharm写的代码passwd:''与mysql数据库设定不一致,把自己代码改成与当时MySQL设置的时候一致;
(11).
raise RuntimeError( RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods
解决方案:
把setting.py文件中[DATABASES]代码改成: DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.sqlite3’,
‘NAME’: BASE_DIR / ‘db.sqlite3’,
} }
(12).
a bytes-like object is required, not ‘str’
解决方案:
pycharm自己会生成 :
import str as str把这个pycharm生成的引用删掉