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.

issue with pipx dependency conflicting with package dependency, Click

See original GitHub issue

I’m running into an issue with the clokta package. It depends on Click. It seems like it is pipx thinks it is already installed because Click is a dependency of pipx itself.

Requirement already satisfied: click in /usr/local/Cellar/pipx/0.14.0.0/libexec/lib/python3.7/site-packages (from clokta) (7.0)
╰─ pipx install clokta --verbose
pipx > (run_pipx_command:134): Virtual Environment location is /Users/johria/.local/pipx/venvs/clokta
pipx > (run:97): running /usr/local/opt/python/bin/python3.7 -m venv --without-pip /Users/johria/.local/pipx/venvs/clokta
pipx > (run:97): running /Users/johria/.local/pipx/venvs/clokta/bin/python -m pip install clokta
Collecting clokta
  Using cached https://files.pythonhosted.org/packages/7c/de/02c8f5a51ebacea04e52745852a3dc691d40e78d0fdf0be9f53ea2855561/clokta-4.1.0-py3-none-any.whl
Collecting enum-compat (from clokta)
Collecting boto3 (from clokta)
  Using cached https://files.pythonhosted.org/packages/42/b5/03da45c451b4e7d31bc42e3b844cbb2e9fc6e8757705504d828a7295b27e/boto3-1.9.245-py2.py3-none-any.whl
Collecting beautifulsoup4 (from clokta)
  Using cached https://files.pythonhosted.org/packages/3b/c8/a55eb6ea11cd7e5ac4bacdf92bac4693b90d3ba79268be16527555e186f0/beautifulsoup4-4.8.1-py3-none-any.whl
Collecting keyring (from clokta)
  Using cached https://files.pythonhosted.org/packages/b1/08/ad1ae7262c8146bee3be360cc766d0261037a90b44872b080a53aaed4e84/keyring-19.2.0-py2.py3-none-any.whl
Collecting requests (from clokta)
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting configparser (from clokta)
  Using cached https://files.pythonhosted.org/packages/7a/2a/95ed0501cf5d8709490b1d3a3f9b5cf340da6c433f896bbe9ce08dbe6785/configparser-4.0.2-py2.py3-none-any.whl
Requirement already satisfied: click in /usr/local/Cellar/pipx/0.14.0.0/libexec/lib/python3.7/site-packages (from clokta) (7.0)
Collecting botocore<1.13.0,>=1.12.245 (from boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/0e/84/b13b233a344de26796b7b457571c16f2b3d1fab8fb48931208d650cc4d97/botocore-1.12.245-py2.py3-none-any.whl
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Collecting soupsieve>=1.2 (from beautifulsoup4->clokta)
  Using cached https://files.pythonhosted.org/packages/5d/42/d821581cf568e9b7dfc5b415aa61952b0f5e3dede4f3cbd650e3a1082992/soupsieve-1.9.4-py2.py3-none-any.whl
Collecting entrypoints (from keyring->clokta)
  Using cached https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->clokta)
  Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests->clokta)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->clokta)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->clokta)
  Using cached https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore<1.13.0,>=1.12.245->boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting docutils<0.16,>=0.10 (from botocore<1.13.0,>=1.12.245->boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore<1.13.0,>=1.12.245->boto3->clokta)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: enum-compat, six, python-dateutil, jmespath, urllib3, docutils, botocore, s3transfer, boto3, soupsieve, beautifulsoup4, entrypoints, keyring, idna, chardet, certifi, requests, configparser, clokta
Successfully installed beautifulsoup4-4.8.1 boto3-1.9.245 botocore-1.12.245 certifi-2019.9.11 chardet-3.0.4 clokta-4.1.0 configparser-4.0.2 docutils-0.15.2 entrypoints-0.3 enum-compat-0.0.2 idna-2.8 jmespath-0.9.4 keyring-19.2.0 python-dateutil-2.8.0 requests-2.22.0 s3transfer-0.2.1 six-1.12.0 soupsieve-1.9.4 urllib3-1.25.6
pipx > (_symlink_package_apps:551): Same path /Users/johria/.local/bin/clokta and /Users/johria/.local/pipx/venvs/clokta/bin/clokta
  installed package clokta 4.1.0, Python 3.7.4
  These apps are now globally available
    - clokta
done! ✨ 🌟 ✨

This is installed via the latest homebrew release.

$ clokta --version
clokta, version 4.1.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
cs01commented, Oct 15, 2019

It looks fine to me. If you make the change in a PR and the unit tests still pass then I will merge it.

1reaction
AlJohricommented, Oct 11, 2019

as a quick proof of concept, this patch fixes the issue:

diff --git a/pipx/util.py b/pipx/util.py
index 94732d8..ba27eee 100644
--- a/pipx/util.py
+++ b/pipx/util.py
@@ -93,11 +93,12 @@ def get_site_packages(python: Path) -> Path:
 def run(cmd: Sequence[Union[str, Path]], check=True) -> int:
     """Run arbitrary command as subprocess"""
 
+    env = {k:v for k,v in os.environ.items() if k != 'PYTHONPATH'}
     cmd_str = " ".join(str(c) for c in cmd)
     logging.info(f"running {cmd_str}")
     # windows cannot take Path objects, only strings
     cmd_str_list = [str(c) for c in cmd]
-    returncode = subprocess.run(cmd_str_list).returncode
+    returncode = subprocess.run(cmd_str_list, env=env).returncode
     if check and returncode:
         raise PipxError(f"{cmd_str!r} failed")
     return returncode
Read more comments on GitHub >

github_iconTop Results From Across the Web

issue with pipx dependency conflicting with package ... - GitHub
I'm running into an issue with the clokta package. It depends on Click. It seems like it is pipx thinks it is already...
Read more >
Python packages with conflicting dependencies - Stack Overflow
You can use pipx. pipx will do all the work of setting up separate virtual environments for each application, so that all the...
Read more >
Improving Python Dependency Management With pipx and ...
My current dev setup with python, poetry and pipx. ... In that setup, adding a dependency and installing it was two steps: Add...
Read more >
Troubleshooting PyPI package installation | Cloud Composer
This page explains how to troubleshoot dependency conflicts when installing custom PyPI packages. The most common problem with PyPI packages that you might ......
Read more >
pipenv Documentation - Read the Docs
Give you insight into your dependency graph (e.g. $ pipenv graph). ... which means it is possible to define conflicting package versions across...
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