1.win10安装mysqlclient
下载地址 ,下载。
安装出现:
版本不适配,
然后支持cp37 ,不支持cp36
重新下载一个cp37版本的
问题二:
解决方法:
https://blog.csdn.net/qq_38161040/article/details/87929616
2.pip install PyMySQL python3用这个安装
3.python导包错误
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.
原因:pycharm 导入包的时候是要该 .py 文件的上级为 package,但是我新建的是一个目录(directory),是在目录下新建.py 文件(New -- Python File)的 ,所以找不到 导入的文件里的方法。
解决办法:
在pycharm中设置source路径: file–>setting–>project:server–>project structure
右击将该目录的文件夹设置为source,这样import的模块类等,就是通过这些source文件夹作为根路径来查找,也就是在这些source文件夹中查找import的东西。
4. f = open(file_name_or_filelike_obj, 'w+b')
PermissionError: [Errno 13] Permission denied: 'myresult.xlsx'
问题原因:myresult.xlsx文件被占用,关闭myresult.xlsx这个文件再运行一次就可以了
5.TypeError: 'list' object is not callable
索引用的是[] 而不是()