{"id":1135,"hash":"8e177ce464f3792cc6215187eee157733f23e802513b5fd7984d90278c14577a","pattern":"Have PermissionError when I run &quot;poetry run&quot; command","full_message":"Environment\n\nUbuntu 20.04\nPython 3.7.3\nPoetry 1.0.8\n\nMy Problem\n\nI installed poetry to manage packages, and I tried it with following simple project,\n\n.\n└── myproject\n    ├── README.rst\n    ├── myproject\n    │   ├── __init__.py\n    │   ├── main.py\n    ├── myproject.egg-info\n    │   ├── PKG-INFO\n    │   ├── SOURCES.txt\n    │   ├── dependency_links.txt\n    │   ├── requires.txt\n    │   └── top_level.txt\n    ├── poetry.lock\n    ├── pyproject.toml\n    └── tests\n        ├── __init__.py\n        └── test_myproject.py\n\nTo run main.py I tried\n\n$ poetry run myproject/main.py\n\nBut I had an error, which says,\n\n[PermissionError]\n[Errno 13] Permission denied\n\nWhat I tried\n\nTo run my code, I tried another way.\n\n$ poetry shell\n(myproject-x8XipcUE-py3.7)$ python myproject/main.py\n\nI had no error...\n\nWhat is the problem for my poetry run command?","ecosystem":"pypi","package_name":"python-poetry","package_version":null,"solution":"My guess is that myproject/main.py isn't an executable (doesn't have the 'x') permission. That's why you can run it with python myproject/main.py, but can't run it as the main exe. To fix it, run chmod +x myproject/main.py, and then try poetry run again. \n\nOf course, you'll have to have a proper Shebang at the very top of main.py. Something like #!/usr/bin/env python (again - at the very beginning of the file).","confidence":0.8,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/62241367/have-permissionerror-when-i-run-poetry-run-command","votes":25,"created_at":"2026-04-19T04:52:24.099625+00:00","updated_at":"2026-04-19T04:52:24.099625+00:00"}