使用诗歌 python 项目使用 gdown 下载大文件时如何定位到正确的解释器?
我正在诗歌 python 项目中使用 gdown 从 Google Drive 下载大文件。执行chmod +x bin/download_model
和bin/download_model后,我收到错误的解释器:权限被拒绝
错误。在我的项目根目录中,我有文件夹 bin 和 asset,并且在 bin 文件夹中,文件 download_model 使用以下命令生成:
#!/home/user/.cache/pypoetry/virtualenvs/my_project-67vF9gQQ-py3.9 python
import gdown
gdown.download(
"https://drive.google.com/uc?id=1V8itWtowCYnb2Bc9KlK9SxGff9WwmogA",
"assets/model_state_dict.bin",
)
我如何定位到正确的解释器,我正在使用的解释器是 poetry env info -- path 命令检索。
这是我得到的日志:
bash: bin/download_model: /home/user/.cache/pypoetry/virtualenvs/my_project-analysis-67vF9gQQ-py3.9: wrong interpreter: Permission denied
I'm using gdown for downloading a large file from Google Drive within a poetry python project. After executing chmod +x bin/download_model
and bin/download_model, I got a wrong interpreter: Permission denied
error. In my project root I have the folders bin and assets and within bin folder the file download_model yields with this comands:
#!/home/user/.cache/pypoetry/virtualenvs/my_project-67vF9gQQ-py3.9 python
import gdown
gdown.download(
"https://drive.google.com/uc?id=1V8itWtowCYnb2Bc9KlK9SxGff9WwmogA",
"assets/model_state_dict.bin",
)
How can I target to the right interpreter, the one I'm using is the one that poetry env info --path
command retrieves.
This is the log I got:
bash: bin/download_model: /home/user/.cache/pypoetry/virtualenvs/my_project-analysis-67vF9gQQ-py3.9: wrong interpreter: Permission denied
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,问题是您没有激活虚拟环境。
要激活它,您可以使用工作 venv 连接到新 shell 或通过会话激活它。
1.
As I understood, the problem is that you didn't activated your virtual environment.
To activate it you may either connect to a new shell with working venv or activate it through your session.
1.