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.

Capital letter in directory name causes pip editable install to fail in Windows

See original GitHub issue

Description

In Windows when the directory name of a Python project, such as a just cloned Git repository, contains a capital letter, installing it with -e (for editable) will result in a “Succesfullly installed”-message, but it actually failed: in pip list the package is nowhere to be found. In macOS I’m not having this issue.

With capital letter in directory name

pip_issue_1

Note that it reported Successfully installed example but without version number.

All lowercase letters

pip_issue_2

Expected behavior

No response

pip version

21.1.2

Python version

3.8.10

OS

Windows 10 21.1.2

How to Reproduce

I createda simple repo to reproduce the above example, but you can try it with any other repository as well.

git clone https://github.com/sandertan/Example
cd Example
pip install -e .

As mentioned previously, this only occurs in Windows and not on macOS. I’m using Bash that came with Git, and I also experienced this bug with the default Windows Shell.

Output

No response

Code of Conduct

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
pfmoorecommented, Jun 18, 2021

This doesn’t happen for me:

PS 20:20 (test1) 00:00.038 C:\Work\Scratch\ex
❯ pip list
Package    Version
---------- -------
pip        21.1.2
setuptools 57.0.0
wheel      0.36.2
PS 20:21 (test1) 00:02.552 C:\Work\Scratch\ex
❯ git clone https://github.com/sandertan/Example
Cloning into 'Example'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
PS 20:22 (test1) 00:01.304 C:\Work\Scratch\ex
❯ cd .\Example\
PS 20:22 (test1) [Git: main] 00:00.027 C:\Work\Scratch\ex\Example
❯ pip install -e .
Obtaining file:///C:/Work/Scratch/ex/Example
Collecting PyYAML
  Using cached PyYAML-5.4.1-cp39-cp39-win_amd64.whl (213 kB)
Installing collected packages: PyYAML, example
  Running setup.py develop for example
Successfully installed PyYAML-5.4.1 example-0.1.0
PS 20:22 (test1) [Git: main] 00:01.944 C:\Work\Scratch\ex\Example
❯ pip list
Package    Version Location
---------- ------- --------------------------
example    0.1.0   c:\work\scratch\ex\example
pip        21.1.2
PyYAML     5.4.1
setuptools 57.0.0
wheel      0.36.2

Could you do dir %VIRTUAL_ENV%\Lib\site-packages? I’d expect to see an easy-install.pth in there with the location of your example project in it, and an example.egg-link file with the Example directory path in it and a line containing “.”

1reaction
pfmoorecommented, Jun 18, 2021

This looks like it might be a mingw64 copy of Python, which is fairly heavily patched. Can you reproduce this issue with the standard python.org (or Windows Store) distribution of Python? If you can’t, I’d suggest that you may need to take this up with the mingw project, as it’s likely their port that’s the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is pip editable install causing issue with subpackages?
As far as I know, editable installations do not work with changes to the directory structure, as done with package_dir .
Read more >
PyPi Package Registry is case sensitive (#244412) - GitLab
Using the latest stable pip ( 20.2.2 ), this makes packages with capital letters impossible to retrieve as pip will make the name...
Read more >
How to Publish an Open-Source Python Package to PyPI
First, have a look at the directory structure of reader . The package lives completely inside a directory that can be named anything....
Read more >
how do editable pip installs work? (intermediate) anthony ...
today I talk about ` pip install -e .` and how that makes a library live- editable !playlist: ...
Read more >
pipenv Documentation - Read the Docs
Generates and checks file hashes for locked dependencies when installing from Pipfile.lock. • Automatically install required Python version when pyenv is ...
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