工欲善其事—python使用过程中遇到的一些安装库的问题解决方法

  1. 代码中有中文时,自用geany+py3.7编译器

    注意:Python3.X 源码文件默认使用utf-8编码,所以可以正常解析中文,无需指定 UTF-8 编码。

    注意:如果你使用编辑器,同时需要设置 py 文件存储的格式为 UTF-8,否则会出现类似以下错误信息:geany默认gbk,https://blog.csdn.net/ma20120607/article/details/80203683 从这里修改为utf-8

  2. pip install xxx安装速度慢,参见https://blog.csdn.net/fgc06/article/details/82503439

  3. 配置pyqt5+qtdesigner+pycharm有很多坑,参见网上教程安装好的话,可能会发现qt5-tools目录下没有designer.exe(5.9以上的可能都没有),这个时候用everthing搜一下,放进正确的文件夹内,qt生成的ui文件的配置方法,在pycharm external里面配置qtdesigner和pyuic按照教程https://blog.csdn.net/stormdony/article/details/80400032写的详尽完善。添加完以后,由ui生成的py文件执行了没有效果,参见这篇文章https://blog.csdn.net/richenyunqi/article/details/80303351

  4. 解决pycahrm  this inspection detects names that should resolve but don't.due to dynamic dispatch and duck typing,this is possible in a limited but useful number of cases .top-level and class-level items are supported better than instance items
    https://blog.csdn.net/zhangyu4863/article/details/80212068

  5. qtdesigner闪退问题可能的解决办法:删除~\AppData\Roaming\QtProject文件夹,然后再打开Qt Creator即可。Linux下,~是/home/YourUserNameWindows下,~是C:\Users\YourUserName

  6. 安装任何插件比如pyinstaller,pyqt5等等因为网站在国外的问题会很慢,尽量安装豆瓣上的镜像

  7. https://blog.csdn.net/jiangmengying01/article/details/78727581关了python环境才能使用cmd窗口命令安装东西、

  8. 国内python库安装相对较慢,使用清华大学镜像软件源安装python一些库:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy 以此为例子,只要把numpy替换成你需要安装的库名就可以啦!

猜你喜欢

转载自blog.csdn.net/wyh196646/article/details/88375012