[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Eryk Sun


Eryk Sun  added the comment:

In 3.10, you should be able to work around the problem for the venv 
site-packages directory by setting the environment variable "PYTHONPLATLIBDIR" 
to "Lib". This sets sys.platlibdir, which the site module uses to create the 
site-packages directory. The default value is "lib", which isn't properly 
capitalized.

In 3.11, sys.platlibdir defaults to "DLLs" in Windows, and the site module 
ignores this attribute. However, the site module does hard code the properly 
capitalized value "Lib".

In POSIX, sys.platlibdir (e.g. "lib" or "lib64") is a common base directory for 
the standard library and its extension modules. It isn't just the directory for 
extension modules, as might be implied by changing the value to "DLLs" in 
Windows. The "DLLs" directory in Windows Python is split off from "Lib" (for 
some legacy reason, I suppose), so Windows would need separate sys.platlibdir 
("Lib") and sys.platextdir ("DLLs") values, if that mattered, which it doesn't 
since the names are fixed.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

Okay, so that means there's some code somewhere that has a lowercase "lib".

If you change it back to "Lib", can you do "python -m pip"? If that works, but 
a direct "pip" does not, it'll be an issue in pip (or a dependency), as those 
executables are generated by them.

There are likely many places where we rely on case-insensitivity throughout the 
codebase though, and certainly a number of places where we unconditionally 
casefold on Windows before doing comparisons. It's going to take a decent 
amount of time to track these down, and may not always be feasible, but if we 
can start enumerating them then it's worth making the fixes.

--
versions: +Python 3.11 -Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Darrel O'Pry


Darrel O'Pry  added the comment:

renaming Lib to lib seems to also resolve the problem...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Steve Dower


Steve Dower  added the comment:

As a quick (wild) guess, is it expecting the "Lib" directory to be lowercase 
"lib"?

Could you try renaming that directory in your venv and see if it changes 
anything?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46950] Windows 11, VENV not working with case sensitive windows paths

2022-03-14 Thread Darrel O'Pry


Darrel O'Pry  added the comment:

I've done some additional troubleshooting today. I have case sensitivity 
enabled in my git checkouts where I am creating the virtual env. I do this for 
a more consistent cross-platform experience for managing code with team members 
also using linux and macos. I have had issues in the past with case changes in 
filenames causing issue on projects and enabling case sensitivity has eliminate 
these issues when working with my counterparts on other platforms. 


I've tested the following with both powershell and bash. 

```
mkdir test-venv-case-sensitivity
cd test-venv-case-sensitivity
fsutil.exe file setCaseSensitiveInfo . enable
python -m venv ./venv
./venv/Scripts/Activate.ps1
pip # you should get the error "No module named 'pip'
cd ./venv/
fsutil.exe file setCaseSensitiveInfo . disable
pip # the command now works
```

This wasn't an issue prior to upgrading to Windows 11, so something may have 
changed in the handling of the case sensitivity flag on Windows. 

I have a venv created on windows 10, prior to my windows 11 upgrade that does 
work. 

I didn't encounter the issue until setting up an installation of Python 3.9.10 
to support another project, then trying to create a new 3.10.2 venv. 

I can work around the issue by specifically disabling case sentitivity in my 
venv folders, but it would be nice if venvs worked out of the box with case 
sensitive filesytems on windows. 


It seems like some code is making assumptions about case sensitivity on 
windows. 




I found that if I disable case sensitivity in the venv folder, the venv starts 
working again.

--
title: Windows 11 venv -> Windows 11, VENV not working with case sensitive 
windows paths

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com