shapely / shapely/shapely

`os.add_dll_directory` "The filename or extension is too long"

Open
#1,324 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.5k
Forks
631
Avg merge
1d 11h
Merged PRs (30d)
10

Description

Steps to reproduce the problem.

pip install vickers_hardness # depends on `shapely` via `uncertainty_toolbox`
from vickers_hardness.vickers_hardness_ import VickersHardness

> [WinError 206] The filename or extension is too long: 'C:\\Users\\sterg\\Miniconda3\\envs\\crabnet\\lib\\site-packages\\Shapely.libs'
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\os.py]()", line 1105, in add_dll_directory
>     cookie = nt._add_dll_directory(path)
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\shapely\__init__.py]()", line 14, in _delvewheel_init_patch_0_0_18
>     os.add_dll_directory(libs_dir)
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\shapely\__init__.py]()", line 30, in <module>
>     _delvewheel_init_patch_0_0_18()
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\uncertainty_toolbox\metrics_calibration.py]()", line 10, in <module>
>     from shapely.geometry import Polygon, LineString
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\uncertainty_toolbox\metrics.py]()", line 9, in <module>
>     from uncertainty_toolbox.metrics_calibration import (
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\uncertainty_toolbox\__init__.py]()", line 9, in <module>
>     from .metrics import (
>   File "[C:\Users\sterg\miniconda3\envs\crabnet\Lib\site-packages\vickers_hardness\vickers_hardness_.py]()", line 12, in <module>
>     import uncertainty_toolbox as uct
>   File "[C:\Users\sterg\Documents\GitHub\sparks-baird\CrabNet\crabnet\examples\extend_features_compare.py]()", line 24, in <module>
>     from vickers_hardness.vickers_hardness_ import VickersHardness

Operating system

Windows 11 Home (21H2)

Shapely version and provenance

Shapely==1.8.1.post1

Other

Related: https://stackoverflow.com/questions/10724642/windowserror-error-206-the-filename-or-extension-is-too-long-after-running

Pretty sure I have long paths enabled in Windows, and the path it mentioned doesn't seem that long.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce on Windows 11 with Shapely==1.8.1.post1 by installing vickers_hardness and importing VickersHardness from vickers_hardness.vickers_hardness_. Inspect the Shapely initialization path shown in the traceback, especially os.add_dll_directory and _delvewheel_init_patch_0_0_18. Done means the import no longer raises WinError 206 for the reported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.