question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

installing with Pipfile behaves differently when installing without when using incompatible packages

See original GitHub issue

Be sure to check the existing issues (both open and closed!).

Describe the issue briefly here.

installing incompatible packages on purpose. azure 2.00 wants azure-mgmt-compute ~1.0.0, but we need 3.0.1. so far works for us using just pip

This works fine:

pipenv install --skip-lock azure==2.0.0 azure-mgmt-compute==3.0.1

However, if we want to recreate the virtualenv from scratch and use the Pipfile generated by the above command, the result is that we have both 1.0.0 and 3.0.1 of azure-mgmt-compute installed in site-packages. I can verify this by looking at …/site-packages/azure/mgmt/compute/. If there is another computer dir under that, then 1.0.0 is installed. If compute_management_client.py is there, then 3.0.1 is installed. It seems though that 1.0.0 is active because of the errors we get when running our code.

Please run $ python -m pipenv.help, and paste the results here.

$ python -m pipenv.help output

Pipenv version: '11.10.0'

Pipenv location: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pipenv'

Python location: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python'

Other Python installations in PATH:

  • 2.6: /opt/local/bin/python2.6

  • 2.6: /opt/local/bin/python2.6

  • 2.6: /opt/local/bin/python2.6

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /opt/local/bin/python3.6m

  • 3.6: /opt/local/bin/python3.6

  • 3.6: /opt/local/bin/python3.6

  • 2.7.14: /opt/local/bin/python

  • 2.7.14: /opt/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.14: /opt/local/bin/python2

  • 2.7.14: /opt/local/bin/python2

  • 3.6.4: /opt/local/bin/python3

  • 3.6.4: /opt/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.5.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.5.0: Mon Mar  5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64',
 'python_full_version': '2.7.14',
 'python_version': '2.7',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_PROGRAM_VERSION
  • LOGNAME
  • USER
  • HOME
  • PATH
  • PYTHONUNBUFFERED
  • DISPLAY
  • TERM_PROGRAM
  • LANG
  • TERM
  • Apple_PubSub_Socket_Render
  • COLORFGBG
  • CDPATH
  • SHLVL
  • VIEW_NAME
  • XPC_FLAGS
  • ITERM_SESSION_ID
  • VIEW_DIR
  • GITLAB_PRIVATE_TOKEN
  • TERM_SESSION_ID
  • XPC_SERVICE_NAME
  • OMF_PATH
  • SSH_AUTH_SOCK
  • SHELL
  • PYTHONDONTWRITEBYTECODE
  • ITERM_PROFILE
  • PIP_PYTHON_PATH
  • OMF_CONFIG
  • TMPDIR
  • __CF_USER_TEXT_ENCODING
  • PWD
  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  • COLORTERM

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /opt/local/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/gdavid/bin
  • SHELL: /opt/local/bin/fish
  • LANG: en_US.UTF-8
  • PWD: /Users/gdavid/pipenv-test-2

Contents of Pipfile (‘/Users/gdavid/pipenv-test-2/Pipfile’):

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

[dev-packages]

[packages]
azure = "==2.0.0"
azure-mgmt-compute = "==3.0.1"

[requires]
python_version = "2.7"

If you’re on MacOS, just run the following:

$ python -m pipenv.help | pbcopy

error running this on my Mac:

Traceback (most recent call last): File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 174, in _run_module_as_main “main”, fname, loader, pkg_name) File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code exec code in run_globals File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pipenv/help.py”, line 89, in <module> main() File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pipenv/help.py”, line 48, in main print(u’Pipenv–specific environment variables:‘) UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2013’ in position 6: ordinal not in range(128)

And this in my clipboard:

$ python -m pipenv.help output

Pipenv version: '11.10.0'

Pipenv location: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pipenv'

Python location: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python'

Other Python installations in PATH:

  • 2.6: /opt/local/bin/python2.6

  • 2.6: /opt/local/bin/python2.6

  • 2.6: /opt/local/bin/python2.6

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /opt/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /opt/local/bin/python3.6m

  • 3.6: /opt/local/bin/python3.6

  • 3.6: /opt/local/bin/python3.6

  • 2.7.14: /opt/local/bin/python

  • 2.7.14: /opt/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.14: /opt/local/bin/python2

  • 2.7.14: /opt/local/bin/python2

  • 3.6.4: /opt/local/bin/python3

  • 3.6.4: /opt/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.5.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.5.0: Mon Mar  5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64',
 'python_full_version': '2.7.14',
 'python_version': '2.7',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_PROGRAM_VERSION
  • LOGNAME
  • USER
  • HOME
  • PATH
  • PYTHONUNBUFFERED
  • DISPLAY
  • TERM_PROGRAM
  • LANG
  • TERM
  • Apple_PubSub_Socket_Render
  • COLORFGBG
  • CDPATH
  • SHLVL
  • VIEW_NAME
  • XPC_FLAGS
  • ITERM_SESSION_ID
  • VIEW_DIR
  • GITLAB_PRIVATE_TOKEN
  • TERM_SESSION_ID
  • XPC_SERVICE_NAME
  • OMF_PATH
  • SSH_AUTH_SOCK
  • SHELL
  • PYTHONDONTWRITEBYTECODE
  • ITERM_PROFILE
  • PIP_PYTHON_PATH
  • OMF_CONFIG
  • TMPDIR
  • __CF_USER_TEXT_ENCODING
  • PWD
  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  • COLORTERM

Expected result

Describe what you expected.

Expected running with or without a Pipfile would result in the same installation.

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Installing with the Pipfile installed azure-mgmt-compute 3.0.1 first then installed azure-mgmt-compute 1.0.0 on top of it.

Running without the Pipfile resulted in 1.0.0 installed first and then 3.0.1 on top of it which uninstalls 1.0.0. Probably because I specify the order of the packages: pipenv install --skip-lock azure==2.0.0 azure-mgmt-compute==3.0.1

Whereas I can’t specify the order of the packages when running form the Pipfile.

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).

run the following:

pipenv install --skip-lock azure==2.0.0 azure-mgmt-compute==3.0.1

This will have the expected result: azure-mgmt-compute==3.0.1 is installed

Then delete the virtualenv: pipenv --rm

The using the generated Pipfile: pipenv install

This will have both 1.0.0 and 3.0.1 installed with 1.0.0 active.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
techalchemycommented, Apr 24, 2018

@gsalsero you can actually put azure in [dev-packages] and azure-mgmt-compute in [packages] and this should allow you to generate a lockfile:

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

[packages]
azure-mgmt-compute = "==3.0.1"

[dev-packages]
azure = "*"

[requires]
python_version = "3.6"

This is a nifty workaround that I usually recommend, since pipenv will always let packages win conflicts when they are encountered.

0reactions
gsalserocommented, Apr 25, 2018

I appreciate your help. That works like charm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pycharm warns package requirement not satisfied when using ...
It seems like maybe when you install via the terminal, it installs to a different virtualenv, updates the Pipfile.lock, and then PyCharm detects ......
Read more >
pipenv Documentation - Read the Docs
This tutorial walks you through installing and using Python packages. It will show you how to install and use the necessary tools and...
Read more >
pipenv Documentation
This tutorial walks you through installing and using Python packages. It will show you how to install and use the necessary tools and...
Read more >
Pipenv: A Guide to the New Python Packaging Tool
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Pipfile won't lock when it tries to install packages that don't exist, i.e., typos. ... Pipenv looks for the package you specify, whether...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found