Howdy! Sorry you're having trouble. To expedite your experience,
provide some basics for me:
Operating system: macOS High Sierra 10.13.4
Python version: 2.7.10/3.7.0
Black version: N/A
Does also happen on master:
If i use pip i get this:
pip install black
Collecting black
Could not find a version that satisfies the requirement black (from versions: )
No matching distribution found for black
So i tried installing from Github and got this:
pip install "git+https://github.com/ambv/black.git"
Collecting git+https://github.com/ambv/black.git
Cloning https://github.com/ambv/black.git to /private/var/folders/d1/xvn4kf7501xbnpp3grb11w6rhdspfc/T/pip-req-build-SvhG55
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/d1/xvn4kf7501xbnpp3grb11w6rhdspfc/T/pip-req-build-SvhG55/setup.py", line 13
def get_long_description() -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/d1/xvn4kf7501xbnpp3grb11w6rhdspfc/T/pip-req-build-SvhG55/
Is it possible because i have two python version pip is trying to install black as a Python2 package and it therefore fails? How can i solve this problem?
Black requires python 3.6 to run, so your hypothesis is probably right :) Try using pip that ships with python3.6
run into the same problem with python version. install black with brew instead.
I've been having the same issue with Python 3.7
@chespinoza : Probably a good idea to open a new issue ticket for issues with 3.7 and with all the required information (unless there is an existing open issue for that version already).
Black requires python 3.6 to run, so your hypothesis is probably right :) Try using pip that ships with python3.6
This is helpful in a pragmatic way, but is there any good info on when other Python versions are likely to be supported? Many of us work in managed environments where we don't have a choice of Python version, but would love to use such a useful tool in our daily work.
We're unlikely to support running Black using Python versions lower than 3.6.
Just came across same issue on Mojave:
pip3 install black
Add aliases for py3 if you like to make it permanent (In ~/.bashrc or ~/.zshrc):
alias python="python3"
alias pip="pip3"
I fixed this by adding the --pre flag, to install the python 3.7 pre-release version of black :)
pip install --pre black
or with pipenv:
pipenv install --dev --pre black
Using python 3.7 on Windows 10
Python 3.7.4 conda env. pip install black still gives Could not find a version that satisfies the requirement black and i tried --pre flag, didn't help.
Also using brew is not an option, i want to have black as dependency and manage dependencies with pip only.
I had this issue using Ubuntu 16.04 and python3.7. pip install --pre black was not useful for me. The issue I faced was that no python dev libraries were installed. After, sudo apt install python3.7-dev, it works.
Why is this issue closed? @zsol
Running 3.7.6 on MacOS Mojave and getting:
In file included from regex_3/_regex.c:48:
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:25:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cv/ppbrx60d5ss85z4ryygmmswjlftsg3/T/pip-install-1bo1zb4y/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/cv/ppbrx60d5ss85z4ryygmmswjlftsg3/T/pip-install-1bo1zb4y/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cv/ppbrx60d5ss85z4ryygmmswjlftsg3/T/pip-record-le0u05m8/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Running pip install --pre black does not work.
It's closed because the issue was about not being able to install black on python 2.7
pip install --pre black also did not work for me.
Upgrading my python with brew upgrade python did the trick. After upgrading, I immediately was able to install black with pip3 install black
Most helpful comment
Black requires python 3.6 to run, so your hypothesis is probably right :) Try using pip that ships with python3.6