ERROR: Could not install packages due to an EnvironmentError: [WinError 145] 目录不是空的。: 'D:\\Python\\Python\\venv\\Lib\\site-packages\\~jango\\contrib\\postgres\\locale\\fr'
在安装django过滤插件时报错,如下:
(venv) D:\python_learn\restfullearn\RESTAPI>pip install django-filter Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting django-filter Downloading https://pypi.tuna.tsinghua.edu.cn/packages/35/94/e516d7f41adecb9fd280c89feceb98fa58f6966a583035c8016ed455c4e5/django_filter-2.3.0-py3-none-any.whl (73 kB) |████████████████████████████████| 73 kB 418 kB/s Collecting Django>=2.2 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2b/5a/4bd5624546912082a1bd2709d0edc0685f5c7827a278d806a20cf6adea28/Django-3.1-py3-none-any.whl (7.8 MB) |████████████████████████████████| 7.8 MB 504 kB/s Collecting asgiref~=3.2.10 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d5/eb/64725b25f991010307fd18a9e0c1f0e6dff2f03622fc4bcbcdb2244f60d6/asgiref-3.2.10-py3-none-any.whl (19 kB) Requirement already satisfied: pytz in d:\python\python\venv\lib\site-packages (from Django>=2.2->django-filter) (2020.1) Collecting sqlparse>=0.2.2 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl (40 kB) |████████████████████████████████| 40 kB 1.3 MB/s Installing collected packages: asgiref, sqlparse, Django, django-filter Attempting uninstall: Django Found existing installation: Django 1.11.11 Uninstalling Django-1.11.11: Successfully uninstalled Django-1.11.11 ERROR: Could not install packages due to an EnvironmentError: [WinError 145] 目录不是空的。: 'D:\\Python\\Python\\venv\\Lib\\site-packages\\~jango\\contrib\\postgres\\locale\\fr'
问题解决:
原因:未指定django-filter版本,导致安装最新版本的django-filter时django自动升级,后出现报错情况,将django版本回退,安装对应版本的django-filter==1.1.0;
不再报错
壬戌之秋,七月既望,苏子与客泛舟游于赤壁之下。清风徐来,水波不兴。举酒属客,诵明月之诗,歌窈窕之章。少焉,月出于东山之上,徘徊于斗牛之间。白露横江,水光接天。纵一苇之所如,凌万顷之茫然。浩浩乎如冯虚御风,而不知其所止;飘飘乎如遗世独立,羽化而登仙。
于是饮酒乐甚,扣舷而歌之。歌曰:“桂棹兮兰桨,击空明兮溯流光。渺渺兮予怀,望美人兮天一方。”客有吹洞箫者,倚歌而和之。其声呜呜然,如怨如慕,如泣如诉,余音袅袅,不绝如缕。舞幽壑之潜蛟,泣孤舟之嫠妇。
苏子愀然,正襟危坐而问客曰:“何为其然也?”客曰:“月明星稀,乌鹊南飞,此非曹孟德之诗乎?西望夏口,东望武昌,山川相缪,郁乎苍苍,此非孟德之困于周郎者乎?方其破荆州,下江陵,顺流而东也,舳舻千里,旌旗蔽空,酾酒临江,横槊赋诗,固一世之雄也,而今安在哉?况吾与子渔樵于江渚之上,侣鱼虾而友麋鹿,驾一叶之扁舟,举匏樽以相属。寄蜉蝣于天地,渺沧海之一粟。哀吾生之须臾,羡长江之无穷。挟飞仙以遨游,抱明月而长终。知不可乎骤得,托遗响于悲风。”
苏子曰:“客亦知夫水与月乎?逝者如斯,而未尝往也;盈虚者如彼,而卒莫消长也。盖将自其变者而观之,则天地曾不能以一瞬;自其不变者而观之,则物与我皆无尽也,而又何羡乎!且夫天地之间,物各有主,苟非吾之所有,虽一毫而莫取。惟江上之清风,与山间之明月,耳得之而为声,目遇之而成色,取之无禁,用之不竭,是造物者之无尽藏也,而吾与子之所共适。”
客喜而笑,洗盏更酌。肴核既尽,杯盘狼籍。相与枕藉乎舟中,不知东方之既白。