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

pipenv without internet access - internal pypi mirror only #1783

Closed
panzerballett opened this Issue Mar 19, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@panzerballett
Copy link

panzerballett commented Mar 19, 2018

(Repeatability: offline mirror #1731 is also about offline mirrors but does not cover the issue described here.)

i am working in an environment without internet access. i do have a complete pypi mirror on a server (no SSL/TLS). i manage to use pip (by specifying the server in ~/.config/pip/pip.conf).

i am not able to run pipenv without errors in that environment. while installing usually works (with an error message: pipenv wants to connect to https://pypi.org/pypi/imagesize/json) pipenv lock fails (the lock file is never written because of that error).

this is the output of $ python -m pipenv.help:

$ python -m pipenv.help output Pipenv version: `'11.8.0'`

Pipenv location: '/home/user/.local/lib/python3.5/site-packages/pipenv'

Python location: '/usr/bin/python3'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.5: /usr/bin/python3.5m

  • 3.5: /usr/bin/python3.5

  • 2.7.12: /usr/bin/python

  • 2.7.12: /usr/bin/python2

  • 3.5.2: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.5.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.4.0-23-generic',
 'platform_system': 'Linux',
 'platform_version': '#41-Ubuntu SMP Mon May 16 23:04:25 UTC 2016',
 'python_full_version': '3.5.2',
 'python_version': '3.5',
 'sys_platform': 'linux'}

System environment variables:

  • XMODIFIERS
  • SSH_AUTH_SOCK
  • GDM_LANG
  • DISPLAY
  • XDG_DATA_DIRS
  • LANG
  • _
  • IBUS_DISABLE_SNOOPER
  • XDG_SESSION_ID
  • UNITY_HAS_3D_SUPPORT
  • UPSTART_JOB
  • UPSTART_SESSION
  • JOB
  • DESKTOP_SESSION
  • MANDATORY_PATH
  • WINDOWID
  • LC_TELEPHONE
  • LC_ADDRESS
  • XDG_SESSION_TYPE
  • GTK_IM_MODULE
  • PATH
  • GNOME_KEYRING_PID
  • XDG_SEAT
  • XDG_SESSION_PATH
  • LC_NUMERIC
  • TERMINATOR_UUID
  • LESSCLOSE
  • GIO_LAUNCHED_DESKTOP_FILE_PID
  • COMPIZ_CONFIG_PROFILE
  • SHLVL
  • XDG_SESSION_DESKTOP
  • QT_QPA_PLATFORMTHEME
  • XDG_RUNTIME_DIR
  • IM_CONFIG_PHASE
  • COLORTERM
  • GDMSESSION
  • LC_MONETARY
  • XDG_CONFIG_DIRS
  • SHELL
  • XDG_CURRENT_DESKTOP
  • DEFAULTS_PATH
  • DBUS_SESSION_BUS_ADDRESS
  • LS_COLORS
  • QT_LINUX_ACCESSIBILITY_ALWAYS_ON
  • XDG_VTNR
  • PWD
  • UPSTART_EVENTS
  • PIP_PYTHON_PATH
  • XAUTHORITY
  • UNITY_DEFAULT_PROFILE
  • COMPIZ_BIN_PATH
  • GNOME_KEYRING_CONTROL
  • SESSIONTYPE
  • GTK_MODULES
  • GIO_LAUNCHED_DESKTOP_FILE
  • LC_IDENTIFICATION
  • LC_MEASUREMENT
  • GPG_AGENT_INFO
  • TERM
  • GTK2_MODULES
  • HOME
  • QT_IM_MODULE
  • SESSION
  • XDG_SEAT_PATH
  • CLUTTER_IM_MODULE
  • LESSOPEN
  • LC_PAPER
  • QT4_IM_MODULE
  • INSTANCE
  • USER
  • UPSTART_INSTANCE
  • LC_NAME
  • OLDPWD
  • LANGUAGE
  • ORBIT_SOCKETDIR
  • QT_ACCESSIBILITY
  • LOGNAME
  • LC_TIME
  • XDG_GREETER_DATA_DIR
  • GNOME_DESKTOP_SESSION_ID
  • PYTHONUNBUFFERED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user/.local/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/user/workspaces/spyder3/project

Contents of Pipfile ('/home/user/workspaces/spyder3/project/Pipfile'):

[[source]]

verify_ssl = false
name = "server.local"
# url = "https://pypi.python.org/simple"
url = "http://server.local/python/pypi.python.org/web/simple/"


[packages]

"pep8" = "*"
spyder = "*"


[requires]

python_version = "3.5"


[dev-packages]


Expected result

$ pipenv lock should create Pipfile.lock but that file is never written - due to the failed connection to https://pypi.org/pypi/imagesize/json i suppose.

i'd expect pipenv to connect to my local mirror only. i admit that i do not currently mirror https://pypi.org/pypi/imagesize/json (i'd do that presto if i knew how configure pipenv to check that url only).

Actual result

and here is what happens when i run $ pipenv lock:

$ pipenv lock
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
()[2])
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/../urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/imagesize/json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feb478d82e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/resolver.py", line 75, in <module>
    main()
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/resolver.py", line 65, in main
    clear=do_clear,
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/resolver.py", line 57, in resolve
    verbose=verbose,
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/utils.py", line 452, in resolve_deps
    'https://pypi.org/pypi/{0}/json'.format(name), timeout=10
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/../requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/../requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/../requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/pipenv/../pipenv/../requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/imagesize/json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feb478d82e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

Steps to replicate
  • setup a (partial) pypi mirror
  • make sure there is a connection to the server where the mirror is on but no internet connection
  • setup a pipenv
  • remove Pipenv.lock
  • run $ pipenv lock
@kennethreitz

This comment has been minimized.

Copy link
Contributor

kennethreitz commented Mar 19, 2018

this is not intended usage at this time

@panzerballett

This comment has been minimized.

Copy link

panzerballett commented Mar 19, 2018

yup, this is probably not the most prominent use-case. thanks for your comment. and thanks for pipenv!

@vlcinsky

This comment has been minimized.

Copy link
Contributor

vlcinsky commented Apr 5, 2018

@panzerballett are you using devpi server? It is possible, it would resolve the issue.

@panzerballett

This comment has been minimized.

Copy link

panzerballett commented Apr 5, 2018

@vlcinsky no. i'm not. i will try that and report back (this may take some time...). thanks for the hint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment