Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bindings build accesses internet: Failed to establish a new connection: [Errno 8] Name does not resolve')': /simple/ortools/ #2305

Closed
yurivict opened this issue Dec 30, 2020 · 7 comments
Assignees
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem Lang: Python Python wrapper issue OS: FreeBSD FreeBSD OS
Milestone

Comments

@yurivict
Copy link

What version of OR-tools and what language are you using?
Version: 8.1
Language: Python

What operating system (Linux, Windows, ...) and version?
FreeBSD 12.2

It builds with internet connection, but fails without it:

[414/414] cd /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1 && /usr/local/bin/python3.7 -m venv /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv && /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/bin/python -m pip install --find-links=/wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist ortools && /usr/local/bin/cmake -E copy /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/test.py.in /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/test.py
FAILED: CMakeFiles/python_package.util python/venv
cd /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1 && /usr/local/bin/python3.7 -m venv /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv && /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/bin/python -m pip install --find-links=/wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist ortools && /usr/local/bin/cmake -E copy /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/test.py.in /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/test.py
Looking in links: /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x802fa2b10>: Failed to establish a new connection: [Errno 8] Name does not resolve')': /simple/ortools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x802fc4810>: Failed to establish a new connection: [Errno 8] Name does not resolve')': /simple/ortools/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x802ff0350>: Failed to establish a new connection: [Errno 8] Name does not resolve')': /simple/ortools/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x802ff0510>: Failed to establish a new connection: [Errno 8] Name does not resolve')': /simple/ortools/
@Mizux
Copy link
Collaborator

Mizux commented Dec 30, 2020

My guess is python/venv/bin/python -m pip install --find-links=/wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist ortools still check pypi.org 🤔

@yurivict could you try to run by hand each part of the command to be sure which one is responsible for the issue, i.e.

cd /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1
/usr/local/bin/python3.7 -m venv /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv
/wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/bin/python -m pip install --find-links=/wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist ortools
/usr/local/bin/cmake -E copy /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/test.py.in /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/test.py

@yurivict
Copy link
Author

[yuri@yv /usr/ports/math/py-or-tools/work-py37/or-tools-8.1]$ /usr/local/bin/python3.7 -m venv /wrkdirs/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv
Error: [Errno 13] Permission denied: '/wrkdirs'
[yuri@yv /usr/ports/math/py-or-tools/work-py37/or-tools-8.1]$ /usr/local/bin/python3.7 -m venv /usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv

[yuri@yv /usr/ports/math/py-or-tools/work-py37/or-tools-8.1]$ 
[yuri@yv /usr/ports/math/py-or-tools/work-py37/or-tools-8.1]$ /usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/bin/python -m pip install --find-links=/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist ortools
Looking in links: /usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist
WARNING: Url '/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist' is ignored. It is either a non-existing path or lacks a specific scheme.
ERROR: Could not find a version that satisfies the requirement ortools (from versions: none)
ERROR: No matching distribution found for ortools
WARNING: Url '/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/dist' is ignored. It is either a non-existing path or lacks a specific scheme.
WARNING: You are using pip version 20.1.1; however, version 20.3.3 is available.
You should consider upgrading via the '/usr/ports/math/py-or-tools/work-py37/or-tools-8.1/python/venv/bin/python -m pip install --upgrade pip' command.

@yurivict
Copy link
Author

Version 7.7 didn't have such problem.

@Mizux Mizux self-assigned this Dec 30, 2020
@Mizux Mizux added Build: CMake CMake based build issue Help Needed Modeling/Usage problem Lang: Python Python wrapper issue OS: FreeBSD FreeBSD OS labels Dec 30, 2020
@Mizux Mizux added this to the v8.2 milestone Dec 30, 2020
@Mizux
Copy link
Collaborator

Mizux commented Dec 30, 2020

strange, maybe add a --no-index here:

COMMAND ${VENV_Python_EXECUTABLE} -m pip install --find-links=${CMAKE_CURRENT_BINARY_DIR}/python/dist ${PROJECT_NAME}

ref: https://pip.pypa.io/en/latest/reference/pip_install/#cmdoption-no-index

@yurivict
Copy link
Author

yurivict commented Dec 30, 2020

Now it fails to find the package:

ERROR: Could not find a version that satisfies the requirement absl-py>=0.11 (from ortools) (from versions: none)
ERROR: No matching distribution found for absl-py>=0.11 (from ortools)

despite it being installed:

$ pkg info | grep absl-py
py37-absl-py-0.11.0            Abseil Python Common Libraries

@yurivict
Copy link
Author

I have to apply this patch to make it build w/out internet access:

--- ortools/python/setup.py.in.orig	2020-12-30 17:40:00 UTC
+++ ortools/python/setup.py.in
@@ -42,8 +42,8 @@ setup(
     version='@PROJECT_VERSION@',
     packages=find_packages(),
     install_requires=[
-        'protobuf >= 3.14.0',
-        'absl-py >= 0.11',
+        #'protobuf >= 3.14.0',
+        #'absl-py >= 0.11',
     ],
     package_data={
         '@PROJECT_NAME@':[$<$<NOT:$<PLATFORM_ID:Windows>>:'.libs/*', '../$<TARGET_SONAME_FILE_NAME:ortools>'>],
--- tools/setup.py.in.orig	2020-12-09 16:30:21 UTC
+++ tools/setup.py.in
@@ -42,8 +42,8 @@ setup(
     version='VVVV',
     packages=find_packages(),
     install_requires=[
-        'protobuf >= 3.14.0',
-        'absl-py >= 0.11',
+        #'protobuf >= 3.14.0',
+        #'absl-py >= 0.11',
     ],
     package_data={
         'ortools.constraint_solver' : ['_pywrapcp.dll', '*.pyi'],

It was the same way before 8.1, so this isn't a regression.

@Mizux Mizux modified the milestones: v8.2, v8.3 Feb 10, 2021
@Mizux
Copy link
Collaborator

Mizux commented Mar 22, 2021

Building without internet access is not (won't be) a goal.
I'm happy you find a way to hack it !

@Mizux Mizux closed this as completed Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem Lang: Python Python wrapper issue OS: FreeBSD FreeBSD OS
Projects
None yet
Development

No branches or pull requests

2 participants