Open Simeon2001 opened 2 years ago
Can you try the latest main branch of build? I think the error might be nicer there.
i met the same error, my python=3.7, pip version=22.3.1, operating system is Windows. it said cann't get hatchling/ because of SSL error, but i come to the source site where does exists hatchling from 0.10.0 to 1.9.0 and also i can install other modules(include build0.10.0) using my pip. Looking forward to your help. Here is the log:
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (hatchling)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS U
RL because the SSL module is not available.")': /simple/hatchling/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS U
RL because the SSL module is not available.")': /simple/hatchling/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS U
RL because the SSL module is not available.")': /simple/hatchling/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS U
RL because the SSL module is not available.")': /simple/hatchling/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS U
RL because the SSL module is not available.")': /simple/hatchling/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/hatchling/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=
'pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/hatchling/ (Caused by SSLError("Can't connect to HTTPS URL because the
SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement hatchling (from versions: none)
ERROR: No matching distribution found for hatchling
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.
tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module i
s not available.")) - skipping
WARNING: There was an error checking the latest version of pip.
Traceback (most recent call last):
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\__main__.py", line 375, in main
built = build_call(
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\__main__.py", line 235, in build_package_via_sdist
sdist = _build(isolation, builder, outdir, 'sdist', config_settings, skip_dependency_check)
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\__main__.py", line 145, in _build
return _build_in_isolated_env(builder, outdir, distribution, config_settings)
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\__main__.py", line 113, in _build_in_isolated_env
env.install(builder.build_system_requires)
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\env.py", line 214, in install
_subprocess(cmd)
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\env.py", line 79, in _subprocess
raise e
File "D:\code_setting\conda\envs\pub_list_py38\lib\site-packages\build\env.py", line 76, in _subprocess
subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File "D:\code_setting\conda\envs\pub_list_py38\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\admin\\AppData\\Local\\Temp\\build-env-mln_gg6l\\Scripts\\python.exe', '-Im', 'pip', 'install', '
--use-pep517', '--no-warn-script-location', '-r', 'C:\\Users\\admin\\AppData\\Local\\Temp\\build-reqs-jmxm5gql.txt']' returned non-zero exit status 1.
ERROR Command '['C:\\Users\\admin\\AppData\\Local\\Temp\\build-env-mln_gg6l\\Scripts\\python.exe', '-Im', 'pip', 'install', '--use-pep517', '--no-warn
-script-location', '-r', 'C:\\Users\\admin\\AppData\\Local\\Temp\\build-reqs-jmxm5gql.txt']' returned non-zero exit status 1.
Hi @lien-Gu @henryiii I am getting the same error. Just like you, I am able to install packages using pip however it fails with "WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available." when using the build module. It popped up randomly this week and I have tried all solutions I could find on the internet such as this one: https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in.
Were you able to solve your problem?
For a quick possible fix, you can try using build[virtualenv]
when you install build - that will use a modern, up-to-date copy of pip. Another option is to use -n
/ --no-isolation
when building, which will use your current environment instead of creating one and installing everything you need in it.
Do you have any special PIP_*
variables set?
Hey @henryiii , thanks for the quick suggestions! build[virtualenv]
did not work but --no-isolation
option does build successfully. I think this points towards some sort of problem with the virtualenv interpreter not having access to/having a malformed ssl module. Will update this thread if I find a fix
I was getting the same error message using python 3.9.16 on Windows OS. Trying to install build[virtualenv]
as @henryiii suggested did not work either. I was in a conda environment. After deactivating the environment, python -m build
worked as expected. That may work for you! @lien-Gu @mattgleesonmicrosoft
I confirm to have similar problem when running the build offline. When on Internet - everything works fine. Why would one need Internet connection to build the sdist?Hmm..
You need the Internet to get packages to set up the isolated virtual environment, which is the default. If you want to manually install all of the build dependencies for the package you want to build an SDist for yourself (setuptools or flit or poetry or something else), you can use the no isolated environment flag.
am trying to run python -m build and am getting this error: