Sample Header Ad - 728x90

Configure poetry to create x86 environment

2 votes
0 answers
342 views
# TLDR How can I configure poetry to use/create an x86 environment? # Details My python project has a dependency that is not available for apple silicon (I use a Macbook Pro M2). A plain pip install will run into an error:
installing pyqt-qt5 (5.15.2): Failed
RuntimeError
Unable to find installation candidates for pyqt-qt5 (5.15.2)
## What works Using conda to handle the virtual environment, I can enforce the x86 version of the dependencies like so:
CONDA_SUBDIR=osx-64 conda create -n my-intel-env python=3.11 -y
conda activate my-intel-env
conda env config vars set CONDA_SUBDIR=osx-64
conda deactivate
conda activate my-intel-env
pip install "poetry==1.5.1"
poetry install --with dev
...
  • Installing pymiscutils (0.3.14)
  • Installing pyqt5 (5.15.9)
  • Installing requests-oauthlib (1.3.1)
...
## What doesn't However, I'd like to ditch conda and use poetry exclusively, i.e., *also for creating the venv*. For this, I have a poetry.toml file in the project root:
[virtualenvs]
in-project = true
When running poetry install while not having a venv activated, this will create a .venv folder inside the project root, and install all dependencies into it, which is what I want. However, it fails in the same way as described at the top. **How can I configure poetry to use x86, similarly to how I did it for conda?**
Asked by ElRudi (223 rep)
Sep 29, 2023, 07:00 AM
Last activity: Oct 4, 2023, 10:11 AM