python初学细节笔记
=========================================================
git提交
-
git add . 添加本地
-
git commit -m '修改介绍' 提交
-
git pull 下啦
更改报红的代码
-
git add .
-
git commit -m ''
-
git pull 拉一下代码确认成功
显示Already up to date.成功
-
git push 提交刷新
=========================================================
镜像名称 网址
阿里云 https://mirrors.aliyun.com/pypi/simple/
豆瓣 https://pypi.douban.com/simple/
清华大学(推荐) https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学 http://pypi.hustunique.com/
山东理工大学 http://pypi.sdutlinux.org/
原文链接:https://blog.csdn.net/wangwng158/article/details/126013759
=========================================================
pycharm通过requirements.txt直接安装包
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
一定要加镜像,不然你会后悔的
注意:以上的requirements.txt只是一个txt文档,所以。。。不要以为requirements就是又要在annaconda里安装的,只是一个文件,类似于如下格式:

=========================================================
报错:ImportError: cannot import name ‘OrderedDict‘ from ‘typing‘
解决办法:
查看报错信息,找到maxvit.py的文件路径,然后用记事本打开maxvit.py

将from typing import Any, Callable, List, Optional, OrderedDict,Sequence, Tuple
改为:
from typing import Any, Callable, List, Optional, Sequence, Tuple
from typing_extensions import OrderedDict
也就是将OrderedDict的来源换为typing_extensions
=========================================================
python项目中VSC(或者为git)选项,如果下面没有manage remote选项,则为项目中的.idea文件起作用,故需要彻底删除,或者拉取一个新的项目到本地,然后将拉取的.idea文件拷贝到当前项目下
==========================================================
服务器上搭建rtsp服务器:
docker run -it -e RTSP_PROTOCOLS=tcp --name rtsp -p 8554:8554 -p 1935:1935 -p 8888:8888 aler9/rtsp-simple-server
=============================================================
pycharm编辑配置:


django项目新建python包:
python manage.py startapp third_platform
===============================================================
pycharm没有代码提示功能
1、文件——设置——编辑器——检查里选择要提示的内容
2、将文件根目录设置成源根(我这里就是没有设置成根,什么提示都没有。。。。)
====================================================================
django创建超级用户:
python manage.py createsuperuser
依次输入用户名(12345678)、邮箱(12345678@qq.com)、密码(00000000)

浙公网安备 33010602011771号