python - 在虚拟框中的 Ubuntu 18.04 中的共享目录中创建虚拟环境失败
问题描述
我试图在我的 Ubuntu 18.04 虚拟机中安装烧瓶,以实现发送电子邮件的 API。我遵循本教程:
https://runnable.com/docker/python/dockerize-your-flask-application
尝试设置虚拟环境时,使用以下两个命令出现此错误:
-python3 -m venv venv
错误:
Error: [Errno 30] Read-only file system: 'lib' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib64'
-Virtualenv venv
错误:
File "/usr/lib/python3.6/shutil.py", line 365, in copytree
raise Error(errors)
shutil.Error: [('/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so', '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so', "[Errno 30] Read-only file system: '../../x86_64-linux-gnu/libpython3.6m.so.1' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so'"), ('/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so', '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so', "[Errno 30] Read-only file system: '../../x86_64-linux-gnu/libpython3.6m.so.1' -> '/shared/BerryCert/Agent/Flask_Web/venv/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so'")]
你能向我解释一下这个问题吗?
解决方案
创建时virtualenv
,传递--always-copy
标志。
所以像:virtualenv --always-copy [your-environment]
。
这应该复制环境文件 - 而不是对它们进行符号链接。virtualbox 上的符号链接有时会出现问题。希望这可以帮助!
推荐阅读
- mysql - Docker 容器未连接到 docker 容器 db
- google-apps-script - 从 URL 列表更新 IMPORTRANGE 函数
- sql - 根据其他列的值自动增加列
- firebase - 如何在不触发权限提示的情况下检查 FCM 是否允许通知
- reactjs - 原子设计:如果包装器不可重用,它应该是原子吗?
- java - 当基类已经导致 Kotlin 中的初始化时,如何防止子类私有 var 初始化?
- node.js - 从反应到节点的图像文件未保存在本地存储中
- html - div 中的文本过多不会写在新行上,而是将整个 div 向下推以腾出空间
- flutter - Flutter:GridView的最后一个元素上的FloatingActionButton
- elasticsearch - 未显示 EFK 堆栈 JSON 日志