为了账号安全,请及时绑定邮箱和手机立即绑定

Scrapy startproject 不起作用权限被拒绝:蜘蛛

Scrapy startproject 不起作用权限被拒绝:蜘蛛

杨__羊羊 2023-03-16 17:42:02
我成功安装了 Scrapy。我在新的 Windows 终端上的 ubuntu 上创建了一个虚拟环境。当我尝试创建一个新项目时出现此错误Traceback (most recent call last):  File "/mnt/d/Scrapy/venv/bin/scrapy", line 8, in <module>    sys.exit(execute())  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 143, in execute    _run_print_help(parser, _run_command, cmd, args, opts)  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 98, in _run_print_help    func(*a, **kw)  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/cmdline.py", line 151, in _run_command    cmd.run(args, opts)  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 110, in run    self._copytree(self.templates_dir, abspath(project_dir))  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 83, in _copytree    self._copytree(srcname, dstname)  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 83, in _copytree    self._copytree(srcname, dstname)  File "/mnt/d/Scrapy/venv/lib/python3.8/site-packages/scrapy/commands/startproject.py", line 88, in _copytree    copystat(src, dst)  File "/usr/lib/python3.8/shutil.py", line 376, in copystat    _copyxattr(src, dst, follow_symlinks=follow)  File "/usr/lib/python3.8/shutil.py", line 326, in _copyxattr    os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)PermissionError: [Errno 13] Permission denied: '/mnt/d/Scrapy/demo_pro/module/spiders'
查看完整描述

1 回答

?
largeQ

TA贡献2039条经验 获得超7个赞

Scrapy 使用文件属性做一些在 WSL 下的 Windows 文件系统上不起作用的事情。


作为解决方法,您可以在 WSL 文件系统上创建项目,然后将结果复制到您想要的位置。类似的东西:


$ cd /tmp

$ scrapy startproject demo_pro

$ cp -r demo_pro /mnt/d/Scrapy


查看完整回答
反对 回复 2023-03-16
  • 1 回答
  • 0 关注
  • 180 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信