我成功安装了 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
添加回答
举报
0/150
提交
取消