pipx: [windows] pipx seems to install a package correctly but claims that "symlink missing or pointing to unexpected location"

Describe the bug

Installed flake8 on wsl (windows subsystem for linux) via pipx. Installation completes successfully but pipx reports in red that “symlink missing or pointing to unexpected location”. I notice the same on Windows native.

The reality is that the installation has succeeded and I am able to use the installed flake8.

I have tried with other packages and packages that I have created myself; I get a similar error.

Thank you for pipx, BTW; it has saved me quite a bit of bother. 😃

How to reproduce

16-Mon/09:53 $ pipx install --verbose flake8
pipx > (run_pipx_command:134): Virtual Environment location is /home/snm/.local/pipx/venvs/flake8
pipx > (run:97): running /usr/bin/python3 -m venv --without-pip /home/snm/.local/pipx/venvs/flake8
pipx > (run:97): running /home/snm/.local/pipx/venvs/flake8/bin/python -m pip install flake8
Collecting flake8
  Using cached https://files.pythonhosted.org/packages/26/de/3f815a99d86eb10464ea7bd6059c0172c7ca97d4bdcfca41051b388a653b/flake8-3.7.8-py2.py3-none-any.whl
Collecting entrypoints<0.4.0,>=0.3.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl
Collecting mccabe<0.7.0,>=0.6.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting pycodestyle<2.6.0,>=2.5.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/0e/0c/04a353e104d2f324f8ee5f4b32012618c1c86dd79e52a433b64fceed511b/pycodestyle-2.5.0-py2.py3-none-any.whl
Collecting pyflakes<2.2.0,>=2.1.0 (from flake8)
  Using cached https://files.pythonhosted.org/packages/84/f2/ed0ffb887f8138a8fe5a621b8c0bb9598bfb3989e029f6c6a85ee66628ee/pyflakes-2.1.1-py2.py3-none-any.whl
Installing collected packages: entrypoints, mccabe, pycodestyle, pyflakes, flake8
Successfully installed entrypoints-0.3 flake8-3.7.8 mccabe-0.6.1 pycodestyle-2.5.0 pyflakes-2.1.1
WARNING: You are using pip version 19.2.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pipx > (_symlink_package_apps:554): ⚠️  Filenexists at /home/snm/.local/bin/flake8 and points to /home/snm/.local/bin/flake8, not /home/snm/.local/pipx/venvs/flake8/bin/flake8. Not modifying.
  installed package flake8 3.7.8, Python 3.6.8
    - flake8 (symlink missing or pointing to unexpected location)
done! ✨ 🌟 ✨

16-Mon/09:54 $ pipx list
venvs are in /home/snm/.local/pipx/venvs
apps are exposed on your $PATH at /home/snm/.local/bin
   package flake8 3.7.8, Python 3.6.8
    - flake8 (symlink missing or pointing to unexpected location)

Expected behavior

Perhaps, the error is being misreported?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I believe the manifest file can have a positive effect to anti virus things, no harm to copy them.

I don’t think I’ve seen the manifest file (well I do for Windows development, but not Python entry points), but the script.py-.exe combination is an artifact from the “legacy” Python build format (eggs). You only see them if you use setup.py to install a package, which is almost never these days, except for pip install -e, which still uses it because the editable install is intentionally left out from PEP 517 due to resource constraints, and is still in pre-PEP discussion (words are there will be a PEP in the following months, but don’t hold your breath for that).

The legacy format of .exe, as you discovered, looks for a -script.py companion to actually invoke Python. It does not do anything else on its own. So AFAIK the only easy solution is to just hard code this logic in the discovery process to copy them both to the destination. Alternatively you can jus generate your own .exe a la pip that does not need the companion script file. pip uses distlib, and the API is pretty straightforward.