Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

failed to make an editable install #331

Open
yuuuxt opened this issue Jul 18, 2021 · 1 comment
Open

failed to make an editable install #331

yuuuxt opened this issue Jul 18, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@yuuuxt
Copy link

yuuuxt commented Jul 18, 2021

🐛 Bug Report

failed to make an editable install

🔬 How To Reproduce

Steps to reproduce the behavior:

  1. system-wide it's Anaconda 3.8. there exists poetry, but it's not used as shown below
  2. create an project using all default settings (named python-project)
  3. in the project folder, create a setup.py as follows:
from setuptools import find_packages, setup

setup(
    name="python_project",
    version='0.0.1',

    author='author',

    packages=find_packages(where='python_project'),
    package_dir={'': 'python_project'}
)
  1. in system-wide python & in project folder, run pip install -e ./
  2. getting error:
ERROR: Command errored out with exit status 1:
     command: 'C:\Users\xxx\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\path-to\\python-project\\setup.py'"'"'; __file__='"'"'C:\\path-to\\python-pro
ject\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: C:\path-to\python-project\
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\xxx\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\path-to\\python-project\\setup.py'"'"'; __file__='"'"
'C:\\path-to\\python-project\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"
'"'))' develop --no-deps Check the logs for full command output.
  1. delete pyproject.toml as well as related .pre-commit-config.yaml and .github;
  2. run pip install -e ./ again and it succeeds.

Code sample

NA

Environment

  • OS: Win10 x64
  • Python version, get it with: Anaconda x64 3.8.8

Screenshots

NA

📈 Expected behavior

to create an editable install by just adding a setup.py file.

📎 Additional context

For my specific project, an editable install fits better as it involves pywin32.

I found a "fix" as follows:

  • comment out the build-backend = "poetry.core.masonry.api" line in pyproject.toml;
  • make an editable install with pip install -e . --no-use-pep517
@yuuuxt yuuuxt added the bug Something isn't working label Jul 18, 2021
@TezRomacH TezRomacH self-assigned this Jul 19, 2021
@AlanHassen
Copy link

Be aware of how conda interacts with poetry. The solution:

Create a new conda environment using a yaml file in which you install poetry into the conda environment:
conda env create -f condaenvironment.yaml

The condaenvironment.yaml file:

name: newenv
channels:
  - https://conda.anaconda.org/conda-forge
  - defaults
dependencies:
  - python>=3.6,<3.9
  - poetry=1.1.6
  - poetry-core=1.0.4

Then activate this new environment (conda activate newenv) and run within this environment make install. Do not use the standard system-wide poetry install!

Note that I fixed the poetry & poetry-core versions as the new releases are buggy and cause an error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants