<!-- Do you have a question instead of a bug report or enhancement request? Please ask it on https://stackoverflow.com/questions/tagged/visual-studio-code+python. Unable to install a linter or formatter? 'No installers available'? Windows - https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows Linux - https://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-linux-install-pipclient/ , https://www.tecmint.com/install-pip-in-linux/ Python configuration issues? Please check https://code.visualstudio.com/docs/python/python-tutorial#_prerequisites Otherwise **please** fill in the requested details below. "XXX" markers should not be present in the final bug report. If you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ . --> ## Environment data - VS Code version: 1.34.0 - Extension version (available under the Extensions sidebar): 2019.4.12954 - OS and version: macOS 10.14.5 - Python version (& distribution if applicable, e.g. Anaconda): 3.7.3 - Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv via Poetry - Relevant/affected Python packages and their versions: black ## Expected behaviour Use `--allow-prereleases` option from poetry when installing black (until black comes with a released version). ## Actual behaviour ``` source /Users/kristofferb/Library/Caches/pypoetry/virtualenvs/my-project-py3.7/bin/activate poetry add black ~/Code/my-project % source /Users/kristofferb/Library/Caches/pypoetry/virtualenvs/my-project-py3.7/bin/activate ~/Code/my-project my-project-py3.7 % poetry add black [ValueError] Could not find a matching version of package black add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)... ``` ## Steps to reproduce: 1. Install poetry 2. `poetry new my-project && code my-project` 3. `poetry install` to have it set up venv 4. update .vscode/settings.json python.pythonPath to the venv created by poetry 5. update .vscode/settings.json `python.poetryPath` to the path to the poetry executable (`which poetry`) 3. open my_project/__init__.py, run Format Document 4. On prompt "Formatter autopep8 is not installed. Install?" select "Use Black" 5. Notice that the extension runs a command in the terminal (as described under Actual behavior). ## Logs <!--Output for `Python` in the `Output` panel (`View`→`Output`, change the drop-down the upper-right of the `Output` panel to `Python`) Output from `Console` under the `Developer Tools` panel (toggle Developer Tools on under `Help`; turn on source maps to make any tracebacks be useful by running `Enable source map support for extension debugging`)--> Not relevant, can be provided upon request though
Activity
kbakk commentedon May 24, 2019
Related issue: psf/black#517 Non-prerelease black release
DonJayamanne commentedon May 28, 2019
Duplicate of #5171
if black is being installed, append --allow-prereleases
kimadeline commentedon Jun 20, 2019
Validated