gpt4 book ai didi

python - 不小心运行了 git clean -d -f 并需要返回 python3.7

转载 作者:行者123 更新时间:2023-12-01 01:05:37 26 4
gpt4 key购买 nike

不会再运行它,但我已经设法挽救了大部分内容,除了当我尝试运行 git pull 时出现错误(因为这些文件已被删除)

error: unable to create file /settings/__pycache__/__init__.cpython-37.pyc (Permission denied)
error: unable to create file /settings/__pycache__/base.cpython-37.pyc (Permission denied)
error: unable to create file /settings/__pycache__/dev.cpython-37.pyc (Permission denied)
error: unable to create file /settings/__pycache__/local.cpython-37.pyc (Permission denied)
error: unable to create file /settings/__pycache__/prod.cpython-37.pyc (Permission denied)

因为运行 git clean -d -f . 已删除

Removing lib/python3.6/
Removing lib/python3.7/site-packages/allauth/
Removing lib/python3.7/site-packages/autoslug/
Removing lib/python3.7/site-packages/captcha/
Removing lib/python3.7/site-packages/cities_light/
Removing lib/python3.7/site-packages/debug_toolbar/
Removing lib/python3.7/site-packages/defusedxml/
Removing lib/python3.7/site-packages/oauthlib/
Removing lib/python3.7/site-packages/openid/
Removing lib/python3.7/site-packages/progressbar/
Removing lib/python3.7/site-packages/python_utils/
Removing lib/python3.7/site-packages/ranged_response/
Removing lib/python3.7/site-packages/requests_oauthlib/
Removing lib/python3.7/site-packages/sqlparse/
Removing lib/python3.7/site-packages/unidecode/
Removing lib/python3.7/site-packages/whitenoise/__pycache__/
Removing lib/python3.7/site-packages/whitenoise/runserver_nostatic/__pycache__/
Removing lib/python3.7/site-packages/whitenoise/runserver_nostatic/management/__pycache__/
Removing lib/python3.7/site-packages/whitenoise/runserver_nostatic/management/commands/__pycache__/
Removing success.html
Removing profile_pics/13958293_10209401380008125_7702518920572958301_o_2.JPG
warning: failed to remove /settings/__pycache__/__init__.cpython-36.pyc
warning: failed to remove /settings/__pycache__/base.cpython-36.pyc
warning: failed to remove /settings/__pycache__/prod.cpython-36.pyc
warning: failed to remove /settings/__pycache__/local.cpython-36.pyc
Removing /static/
Removing /migrations/.0011_auto_20190217_1023.py.swp

我不想造成更多损害,并且不确定如何继续。我在 Ubuntu 16.04 上运行这个 Django Python 项目,我需要重新安装 python3.7 吗?

ls -lh 返回

-rw-rw-r-- 1 trillav trillav    0 Mar  6 15:15 all
drwxrwxr-x 3 trillav trillav 4.0K Mar 8 14:03 bin
drwxrwxr-x 2 trillav trillav 4.0K Mar 6 15:15 include
drwxrwxr-x 3 trillav trillav 4.0K Mar 28 12:01 lib
-rw-rw-r-- 1 trillav trillav 59 Mar 6 15:15 pip-selfcheck.json
-rw-rw-r-- 1 trillav trillav 312 Mar 6 15:15 README.md
-rw-rw-r-- 1 trillav trillav 683 Mar 8 14:03 requirements.txt
drwxrwxr-x 3 trillav trillav 4.0K Mar 6 15:15 src

最佳答案

看起来你的项目中有些文件不属于你,你可以找到它

find . \! -user trillav -print

因此要修复它,您可以尝试通过下一个命令更改所有者

sudo chown -R trillav:trillav .

关于python - 不小心运行了 git clean -d -f 并需要返回 python3.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55397523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com