You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Poetry version: Poetry (version 1.7.0.dev0) and Poetry (version 1.6.1)
Python version: 3.8.10
OS version and name: Pop!_OS 22.04 LTS
pyproject.toml:
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.
To reproduce
Create a Dockerfile
# Start from the NVIDIA PyTorch image
FROM nvcr.io/nvidia/pytorch:22.12-py3
ENV DEBIAN_FRONTEND=noninteractive
# Set Poetry variables
# The system site packages are important because we are using docker to give
# us torch!
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache \
POETRY_HOME=/opt/poetry \
POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES=1
WORKDIR /library
# Install poetry with pinned version
RUN pip install git+https://github.com/python-poetry/poetry.git@master
ENV PATH="$PATH:$POETRY_HOME/bin"
root@5c60f989a2c5:/library# python -c "import torch; print(torch.__version__)"
1.14.0a0+410ce96
root@5c60f989a2c5:/library# poetry run python -c "import torch; print(torch.__version__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'torch'
Issue
Hi,
I believe this is related to issue #6035, which has been closed by PR #8359. This is why I've tried this on both the 1.6.1 release as well as the master branch (1.7.0.dev0), but I get exactly the same results. Given that I have set POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES=1 and verified that virtualenvs.options.system-site-packages=true, I expect that:
the output of poetry run python -c "import sys; print(sys.path)" should include /usr/local/lib/python3.8/dist-packages
include-system-site-packages = false in pyenv.cfg should be true
importing torch should work with poetry run python
However, when I go in and manually update pyenv.cfginclude-system-site-packages = true, then
root@5c60f989a2c5:/library# poetry run python -c "import torch; print(torch.__version__)"
1.14.0a0+410ce96
works as expected. However, I feel like I shouldn't be touching that file, right? It seems like I'm doing something that could potentially have some issues?
The text was updated successfully, but these errors were encountered:
Oh, thank you for the find, it seems like I did a poor job looking through past issues. I will try to configure it another way and see if the issue still persists. Although, toggling between 0 and 1 for POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES did change the output of poetry config --list
-vvv
option) and have included the output below.To reproduce
Create a Dockerfile
Build and run docker container
Verify that poetry system-site-packages is set to true
Also check the config of virtualenv
Check python paths
Import torch
Issue
Hi,
I believe this is related to issue #6035, which has been closed by PR #8359. This is why I've tried this on both the 1.6.1 release as well as the master branch (1.7.0.dev0), but I get exactly the same results. Given that I have set
POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES=1
and verified thatvirtualenvs.options.system-site-packages=true
, I expect that:poetry run python -c "import sys; print(sys.path)"
should include/usr/local/lib/python3.8/dist-packages
include-system-site-packages = false
in pyenv.cfg should betrue
poetry run python
However, when I go in and manually update
pyenv.cfg
include-system-site-packages = true
, thenworks as expected. However, I feel like I shouldn't be touching that file, right? It seems like I'm doing something that could potentially have some issues?
The text was updated successfully, but these errors were encountered: