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

Was --site-packages broken by v2018.10.9? #2992

Closed
ryankennedy opened this issue Oct 10, 2018 · 3 comments
Closed

Was --site-packages broken by v2018.10.9? #2992

ryankennedy opened this issue Oct 10, 2018 · 3 comments

Comments

@ryankennedy
Copy link

Issue description

pipenv --site-packages run … appears to have been broken between v2018.7.1 and v2018.10.9. Passing the flag in v2018.10.9 no longer appears to include site packages in any subsequent commands.

Expected result

I expected pipenv --site-packages run … to continue include packages installed directly via pip in subsequent commands.

Actual result

Packages installed directly via pip can not be referenced via (for instance) import foo.

Steps to replicate

  1. Start up a Python 3.7.0 Docker image: docker run -it --rm python:3.7.0-slim-stretch bash
  2. Change to root's home directory: cd
  3. Install the Requests package (our test case): pip install requests
  4. Install pipenv v2018.7.1: pip install pipenv==v2018.7.1
  5. Attempt to import requests from site packages: echo "import requests; print('Success\!')" | pipenv --site-packages run python -
  6. Upgrade to pipenv v2018.10.9: pip install pipenv==v2018.10.9
  7. Remove the previously created virtualenv: pipenv --rm
  8. Attempt to import requests from site packages: echo "import requests; print('Success\!')" | pipenv --site-packages run python -

Under pipenv v2018.7.1 the end result is Python printing Success!. Under pipenv v2018.10.9 the end result is Python failing with ModuleNotFoundError: No module named 'requests'.


$ pipenv --support

Pipenv version: '2018.10.9'

Pipenv location: '/usr/local/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/bin/python'

Python installations found:

  • 3.7.0: /usr/local/bin/python3.7
  • 3.7.0: /usr/local/bin/python3.7m

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.9.93-linuxkit-aufs',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Jun 6 16:55:56 UTC 2018',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • LANG
  • HOSTNAME
  • GPG_KEY
  • PWD
  • HOME
  • TERM
  • PYTHON_VERSION
  • SHLVL
  • PATH
  • PYTHON_PIP_VERSION
  • OLDPWD
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • LANG: C.UTF-8
  • PWD: /root

Contents of Pipfile ('/root/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.7"
@techalchemy
Copy link
Member

techalchemy commented Oct 10, 2018

--site-packages is only useful to pass as a creation argument, not as an argument to run... at least as far as I'm aware, this was never the intended behavior (I could be wrong).

site-packages is an argument that is passed to the virtualenv creation command under the hood to enable site packages availability inside the environment

There are a number of other things that were broken with that release however and I will have a bugfix release out in the next hour or two. If you try installing pipenv from master (pip install -e git+https://github.com/pypa/pipenv.git@master#egg=pipenv) you may find this resolved already -- do let me know!

@nonylene
Copy link
Contributor

nonylene commented Dec 4, 2018

#3352 (issue: #3351) may fix this.

@techalchemy
Copy link
Member

This was fixed by #3352 and is covered by a regression test now. Sorry for the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants