PermissionError:[Errno 13]权限被拒绝:'Pipfile'IBM Hyperledger Indy

时间:2018-09-24 19:11:36

标签: python-3.x pipenv pipfile

运行该项目的启动脚本时遇到问题: https://github.com/IBM-Blockchain-Identity/indy-ssivc-tutorial在GitHub页面上已经存在一个问题(请参阅:https://github.com/IBM-Blockchain-Identity/indy-ssivc-tutorial/issues/7),但尚未得到解决。我认为这一定是某种权限问题,但是我已经使用pipenv锁定并为其赋予了权限,为此项目创建了一个Pipfile。

我当时认为这可能与实际项目无关,也许这只是我一般的错误,这里有人可以提供帮助。

这是尝试启动“ sudo ./manage start”时遇到的错误

> von-web_1  | Traceback (most recent call last): von-web_1  |   File
    > "/usr/local/bin/pipenv", line 11, in <module> von-web_1  |    
    > sys.exit(cli()) von-web_1  |   File
    > "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py",
    > line 722, in __call__ von-web_1  |     return self.main(*args,
    > **kwargs) von-web_1  |   File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py",
    > line 697, in main von-web_1  |     rv = self.invoke(ctx) von-web_1  | 
    > File
    > "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py",
    > line 1066, in invoke von-web_1  |     return
    > _process_result(sub_ctx.command.invoke(sub_ctx)) von-web_1  |   File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py",
    > line 895, in invoke von-web_1  |     return ctx.invoke(self.callback,
    > **ctx.params) von-web_1  |   File "/usr/local/lib/python3.5/dist-packages/pipenv/vendor/click/core.py",
    > line 535, in invoke von-web_1  |     return callback(*args, **kwargs)
    > von-web_1  |   File
    > "/usr/local/lib/python3.5/dist-packages/pipenv/cli.py", line 701, in
    > run von-web_1  |     do_run(command=command, args=args, three=three,
    > python=python, pypi_mirror=pypi_mirror) von-web_1  |   File
    > "/usr/local/lib/python3.5/dist-packages/pipenv/core.py", line 2244, in
    > do_run von-web_1  |     ensure_project(three=three, python=python,
    > validate=False, pypi_mirror=pypi_mirror) von-web_1  |   File
    > "/usr/local/lib/python3.5/dist-packages/pipenv/core.py", line 605, in
    > ensure_project von-web_1  |     project.touch_pipfile() von-web_1  |  
    > File "/usr/local/lib/python3.5/dist-packages/pipenv/project.py", line
    > 559, in touch_pipfile von-web_1  |     with open('Pipfile', 'a'):
    > von-web_1  | PermissionError: [Errno 13] Permission denied: 'Pipfile'
    > von_von-web_1 exited with code 1

2 个答案:

答案 0 :(得分:0)

我已经在使用Python 3.6.3的MacO上安装了Hyperledger Indy SS VC演示。也许是3.6.3版本,我还没有遇到上述问题。我们可以在Github问题列表中看到以下补丁。如果升级Python版本后遇到问题,请告诉我。

  

Pipfile和Pipfile.lock文件已设置Python版本3.5   在文件的顶部。作为补丁,我修复了权限问题   通过在顶部附近添加以下行   von-network / scripts / start_webserver.sh:

     

查找/ * -d型| xargs chmod 777 --silent

     

该命令仅需位于顶部的bin / bash标头之后   将是第2行。确保在“查找”之后使用“ / *”。这应该   仅修复Pipfile错误。

答案 1 :(得分:0)

您可以看到编码系统中发生问题的状态:

$ brew doctor

您可以通过以下命令进行清理:

$ brew cleanup

但是我建议您卸载Python并重新安装:

$ brew uninstall --ignore-dependencies python3
$ brew install python3