当我运行时:
>>> import subprocess
>>> subprocess.run(['/home/nicolas/.local/venvs/docker-compose/bin/python', '-c', "'import sys; print(sys.path[-1])'"], stdout=subprocess.PIPE)
我得到一个空的stdout
:
CompletedProcess(args=['/home/nicolas/.local/venvs/docker-compose/bin/python', '-c', "'import sys; print(sys.path[-1])'"], returncode=0, stdout=b'')
但是当我直接在控制台中运行命令时,我得到了我想要的结果:
$ /home/nicolas/.local/venvs/docker-compose/bin/python -c 'import sys; print(sys.path[-1])'
/home/nicolas/.local/venvs/docker-compose/lib/python3.6/site-packages
有人可以告诉我为什么吗?和/或告诉我如何获得特定venv的sys.path
?
答案 0 :(得分:0)
正如@ Aran-Fey所说,src="/assets/images/image.jpg"
已经逃脱了争论。所以双引号不是必需的。
这有效:
config.serve_static_assets = true
config.assets.compile = true