-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip freeze returns "Permission denied: 'hg'" after using pip install -e #8418
Comments
Is What does it show if you run |
So I don't have
In my repro steps, there is no I'm not sure what makes pip expect to find Mercurial. Oh, I also found #7072. It's about Mercurial and pip freeze and was merged between 19.2.3 and 19.3.1, so it seems likely that the problem started there. I'll look more. |
It’d be awesome if you could |
I'd never heard of that tool! This is awesome. I'm running it between a5b1a57 (19.2.3) and a5b1a57 (19.3.1), which I know as good and bad respectively. This is the result:
It points to commit c0809f4. I'm not sure why this code would run since I don't have Mercurial. But it makes sense to me that if pip is trying to run that code, then the |
Another interesting thing is that the implementation does try to catch the error when hg is not installed (the |
Yes that's really odd. |
Is there anything actionable here? I'm sorry but I can't tell. |
I'm experiencing the same problem with my project. @uranusjr were you able to resolve this? I noticed that an egg was being made with a different name than my source code, due to an uneditted setup.py Removing the egg allowed pip freeze to run properly. |
I haven't taken the time to figure out why my environment behaves in this way. I still have the problem but am still working around it by pinning pip to an earlier version. I'm okay closing the ticket for now (if that's what you're asking), if I can reopen it when I have more information about the problem. |
I encountered this issue recently. I worked around the issue by downgrading pip to 19.2.3. |
It may make sense if we just treat Another choice would be to perform our own command resolution logic (via |
I had the same issue, pip-20.2.4
I had to install hg-git to fix it
|
I’m even more confused to hear your fix worked. What on earth is going on. |
Hi, I am having the same issue with Environment
Diagnostic I have two user profiles for development (named "first" and "second" here). On the first profile, second@imac-de-laurent-1 ~> hg
fish: Unknown command 'hg' So, I took a look on the first profile, it appears that first@imac-de-laurent-1 ~> hg
Mercurial Distributed SCM
[…] The problem is that the second@iMac-de-Laurent ~> ls -l /usr/local/bin/hg
lrwxr-xr-x 1 first admin 93 13 oct 2016 /usr/local/bin/hg -> /Users/first/Applications/SourceTree.app/Contents/Resources/mercurial_local/hg_local So, if I launch this command from the second profile, I get a "permission denied" error: second@iMac-de-Laurent ~> /usr/local/bin/hg
second@iMac-de-Laurent ~ [126]> => exit code is 126 How to fix? From the Pip's point of view, the In my situation, I will try to uninstall SourceTree and reinstall it "globally". |
Once SourceTree uninstalled (and the broken symbolic link removed), I tried second@imac-de-laurent-1 ~/w/my_project(262|M?)> pip freeze --verbose
Created temporary directory: /private/var/folders/lr/hjtkqzxd189dw_x7dk0493h80000gp/T/pip-ephem-wheel-cache-9hFWsh
Checking in /Users/second/workspace/my_project/src for .svn (svn)...
Checking in /Users/second/workspace/my_project/src for .git (git)...
Checking in /Users/second/workspace/my_project/src for .bzr (bzr)...
Checking in /Users/second/workspace/my_project/src for .hg (hg)...
could not determine if /Users/second/workspace/my_project/src is under hg control because hg is not available
No VCS found for editable requirement "my_project==3.1.26" in: '/Users/second/workspace/my_project/src'
...
[list of dependencies] It's curious because my project is under Subversion, so the checking of |
This is arguably a user issue because |
I’ll mark this as “awaiting PR” since it is pretty clear what we want to do. Feel free to try your hands on this and we can continue the discussion from there! |
OK @uranusjr , I'm working on it. I will use an error message suggesting the developper to reinstall the 'hg' (or whatever) tool for all users (globally). For instance: "Command hg is available, but you don't have permission to execute it - Can you ask an admin to reinstall hg for all users?" |
I think we want to #. Suggest installing for the current user. (If the system already has an This is probably be too much to fit in an error message, so we may need to create a paragraph or two in documentation (maybe a section under Installing from local packages), and point the error message to it. So something like
|
Other issueThis is unlikely, but this error may be caused by a security rule (ACL) preventing commands from being executed on certain devices, such as a USB flash drive, the This problem is little known, and it is worth mentioning it. Error message (
|
Bumps [pip](https://github.com/pypa/pip) from 21.0.1 to 21.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/blob/main/NEWS.rst">pip's changelog</a>.</em></p> <blockquote> <h1>21.1 (2021-04-24)</h1> <h2>Process</h2> <ul> <li>Start installation scheme migration from <code>distutils</code> to <code>sysconfig</code>. A warning is implemented to detect differences between the two implementations to encourage user reports, so we can avoid breakages before they happen.</li> </ul> <h2>Features</h2> <ul> <li>Add the ability for the new resolver to process URL constraints. (<code>[#8253](pypa/pip#8253) <https://github.com/pypa/pip/issues/8253></code>_)</li> <li>Add a feature <code>--use-feature=in-tree-build</code> to build local projects in-place when installing. This is expected to become the default behavior in pip 21.3; see <code>Installing from local packages <https://pip.pypa.io/en/stable/user_guide/#installing-from-local-packages></code>_ for more information. (<code>[#9091](pypa/pip#9091) <https://github.com/pypa/pip/issues/9091></code>_)</li> <li>Bring back the "(from versions: ...)" message, that was shown on resolution failures. (<code>[#9139](pypa/pip#9139) <https://github.com/pypa/pip/issues/9139></code>_)</li> <li>Add support for editable installs for project with only setup.cfg files. (<code>[#9547](pypa/pip#9547) <https://github.com/pypa/pip/issues/9547></code>_)</li> <li>Improve performance when picking the best file from indexes during <code>pip install</code>. (<code>[#9748](pypa/pip#9748) <https://github.com/pypa/pip/issues/9748></code>_)</li> <li>Warn instead of erroring out when doing a PEP 517 build in presence of <code>--build-option</code>. Warn when doing a PEP 517 build in presence of <code>--global-option</code>. (<code>[#9774](pypa/pip#9774) <https://github.com/pypa/pip/issues/9774></code>_)</li> </ul> <h2>Bug Fixes</h2> <ul> <li>Fixed <code>--target</code> to work with <code>--editable</code> installs. (<code>[#4390](pypa/pip#4390) <https://github.com/pypa/pip/issues/4390></code>_)</li> <li>Add a warning, discouraging the usage of pip as root, outside a virtual environment. (<code>[#6409](pypa/pip#6409) <https://github.com/pypa/pip/issues/6409></code>_)</li> <li>Ignore <code>.dist-info</code> directories if the stem is not a valid Python distribution name, so they don't show up in e.g. <code>pip freeze</code>. (<code>[#7269](pypa/pip#7269) <https://github.com/pypa/pip/issues/7269></code>_)</li> <li>Only query the keyring for URLs that actually trigger error 401. This prevents an unnecessary keyring unlock prompt on every pip install invocation (even with default index URL which is not password protected). (<code>[#8090](pypa/pip#8090) <https://github.com/pypa/pip/issues/8090></code>_)</li> <li>Prevent packages already-installed alongside with pip to be injected into an isolated build environment during build-time dependency population. (<code>[#8214](pypa/pip#8214) <https://github.com/pypa/pip/issues/8214></code>_)</li> <li>Fix <code>pip freeze</code> permission denied error in order to display an understandable error message and offer solutions. (<code>[#8418](pypa/pip#8418) <https://github.com/pypa/pip/issues/8418></code>_)</li> <li>Correctly uninstall script files (from setuptools' <code>scripts</code> argument), when installed with <code>--user</code>. (<code>[#8733](pypa/pip#8733) <https://github.com/pypa/pip/issues/8733></code>_)</li> <li>New resolver: When a requirement is requested both via a direct URL (<code>req @ URL</code>) and via version specifier with extras (<code>req[extra]</code>), the resolver will now be able to use the URL to correctly resolve the requirement with extras. (<code>[#8785](pypa/pip#8785) <https://github.com/pypa/pip/issues/8785></code>_)</li> <li>New resolver: Show relevant entries from user-supplied constraint files in the error message to improve debuggability. (<code>[#9300](pypa/pip#9300) <https://github.com/pypa/pip/issues/9300></code>_)</li> <li>Avoid parsing version to make the version check more robust against lousily debundled downstream distributions. (<code>[#9348](pypa/pip#9348) <https://github.com/pypa/pip/issues/9348></code>_)</li> <li><code>--user</code> is no longer suggested incorrectly when pip fails with a permission error in a virtual environment. (<code>[#9409](pypa/pip#9409) <https://github.com/pypa/pip/issues/9409></code>_)</li> <li>Fix incorrect reporting on <code>Requires-Python</code> conflicts. (<code>[#9541](pypa/pip#9541) <https://github.com/pypa/pip/issues/9541></code>_)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/pip/commit/2b2a268d25963727c2a1c805de8f0246b9cd63f6"><code>2b2a268</code></a> Bump for release</li> <li><a href="https://github.com/pypa/pip/commit/ea761a6575f37b90cf89035ee8be3808cf872184"><code>ea761a6</code></a> Update AUTHORS.txt</li> <li><a href="https://github.com/pypa/pip/commit/2edd3fdf2af2f09dce5085ef0eb54684b4f9bc04"><code>2edd3fd</code></a> Postpone a deprecation to 21.2</li> <li><a href="https://github.com/pypa/pip/commit/3cccfbf169bd35133ee25d2543659b9c1e262f8c"><code>3cccfbf</code></a> Rename mislabeled news fragment</li> <li><a href="https://github.com/pypa/pip/commit/21cd124b5d40b510295c201b9152a65ac3337a37"><code>21cd124</code></a> Fix NEWS.rst placeholder position</li> <li><a href="https://github.com/pypa/pip/commit/e46bdda9711392fec0c45c1175bae6db847cb30b"><code>e46bdda</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/9827">#9827</a> from pradyunsg/fix-git-improper-tag-handling</li> <li><a href="https://github.com/pypa/pip/commit/0e4938d269815a5bf1dd8c16e851cb1199fc5317"><code>0e4938d</code></a> 📰</li> <li><a href="https://github.com/pypa/pip/commit/ca832b2836e0bffa7cf95589acdcd71230f5834e"><code>ca832b2</code></a> Don't split git references on unicode separators</li> <li><a href="https://github.com/pypa/pip/commit/1320bac4ff80d76b8fba2c8b4b4614a40fb9c6c3"><code>1320bac</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/9814">#9814</a> from pradyunsg/revamp-ci-apr-2021-v2</li> <li><a href="https://github.com/pypa/pip/commit/e9cc23ffd97cb6d66d32dc3ec27cf832524bb33d"><code>e9cc23f</code></a> Skip checks on PRs only</li> <li>Additional commits viewable in <a href="https://github.com/pypa/pip/compare/21.0.1...21.1">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pip&package-manager=pip&previous-version=21.0.1&new-version=21.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually </details>
Environment
Description
After using
pip install -e
to install a local package,pip freeze
returns an error:PermissionError: [Errno 13] Permission denied: 'hg'
.I do not use Mercurial and do not have an
hg
executable on my machine.It happens with pip 19.3.1 and above, when using
-e
.It doesn't happen with pip 19.2.3, and it doesn't happen if I don't use
-e
. It doesn't happen withpip list
.Expected behavior
pip freeze
should return the list of packages.How to Reproduce
Create a simple package, install it using
pip install -e
, then runpip freeze
.It works with pip 19.2.3 but in 19.3.1 or later versions,
pip freeze
returns an error.You can just copy/paste the following, which creates a virtual environment and does the
pip install -e
and thepip freeze
on two different versions of pip:Output
Here's the output of the above commands, starting at the first
pip -V
:pip list
still works. In fact, if I addpip list
just before the problematicpip freeze
in the chain of commands above, there is no error:The text was updated successfully, but these errors were encountered: