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.

Path names not normalized properly with development install on Windows?

See original GitHub issue

I’m trying to install a package with the -e . option (via Pipenv) and am getting the following error:

Using c:\users\user\appdata\roaming\python\python37\site-packages
Finished processing dependencies for echovr-api==0.1.1
An error occurred while installing -e .! Will try again.
  ================================ 6/6 - 00:00:01
Installing initially failed dependencies…
Obtaining file:///E:/User/Programming/projects/echovr-api
Installing collected packages: echovr-api
  Running setup.py develop for echovr-api
    Complete output from command e:\user\programming\projects\echovr-api\.venv\scripts\python.exe -c "import setuptools, tokenize;__file__='E:\\User\\Programming\\projects\\echovr-api\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    running develop
    Checking .pth file support in e:\user\programming\projects\echovr-api\.venv\Lib\site-packages\
    e:\user\programming\projects\echovr-api\.venv\scripts\pythonw.exe -E -c pass
    TEST PASSED: e:\user\programming\projects\echovr-api\.venv\Lib\site-packages\ appears to support .pth files
    error: ("Can't get a consistent path to setup script from installation directory", 'e:\\user\\programming\\projects\\echovr-api\\', 'e:\\user\\programming\\projects\\echovr-api')

This seems odd, because “e:\user\programming\projects\echovr-api\” and “e:\user\programming\projects\echovr-api” are consistent paths, setuptools just seems to be comparing them incorrectly.

I traced the error to this line:

https://github.com/pypa/setuptools/blob/b0c746640f87ad2719a7ebfbdc226d3fd43296b6/setuptools/command/develop.py#L103-L106

Which, in turn, seems to rely on the normalize_path function, which is defined here:

https://github.com/pypa/setuptools/blob/b0c746640f87ad2719a7ebfbdc226d3fd43296b6/pkg_resources/__init__.py#L2232-L2234

Given the docstring description of that function, I want to know if it would make sense to change it to strip trailing path separators. (I can send a PR if so.)

If possible, I’d also like to know if you have any suggestions for a work-around for this error, as I don’t really want to wait for setuptools to be patched before I can continue working on my project.

If necessary, you can reproduce the error by checking out the “wip-test-error” branch of my repository here: https://github.com/Ajedi32/echovr-api/tree/wip-test-error and running pip install --user pipenv && pipenv install

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jaracocommented, Apr 10, 2019

@hobson: the behavior was changed in setuptools 40.6.0, so you’ll need to upgrade setuptools also to get the improved behavior.

0reactions
hobsoncommented, Apr 16, 2019

So pip install --upgrade pip setuptools because pip doesn’t include the latest setuptools as a dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximum Path Length Limitation - Win32 apps | Microsoft Learn
When using an API to create a directory, the specified path cannot be so long that you cannot append an 8.3 file name...
Read more >
[#QTIFW-175] "Normalize" installation path on Windows in ...
Try to download the package on a clean Windows and when Windows says. "Will you execute this download...", dont check the Box for...
Read more >
Unicode Normalization in Windows - Stack Overflow
There is no need to perform any Unicode normalization on path and file name strings for use by the Windows file I/O API...
Read more >
NormalizeScaleGradient: Bookmark website now! | Page 20
Windows 10 has a limit on the maximum file path length of 260 characters. NSG can add a weight prefix and an '_nsg'...
Read more >
1NF, 2NF, 3NF and BCNF in Database Normalization
Problems Without Normalization. If a table is not properly normalized and have data redundancy then it will not only eat up extra ...
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