Skip to content
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

Filename or extension too long (OSError) on Windows #119

Closed
abhidg opened this issue May 3, 2024 · 10 comments · Fixed by #126
Closed

Filename or extension too long (OSError) on Windows #119

abhidg opened this issue May 3, 2024 · 10 comments · Fixed by #126
Labels
Awaiting author contribution Waiting on the issue author to do something before proceeding

Comments

@abhidg
Copy link
Contributor

abhidg commented May 3, 2024

From @jsteyn - creating a venv and installing inside it fixes the issue

@ethanwhite
Copy link
Collaborator

Thanks @abhidg & @jsteyn. We aren't seeing this in our Windows tests (or on our local Windows machine) so we'll need some more detail in order to explore it.

@hturner
Copy link
Contributor

hturner commented May 3, 2024

Okay, for example on Windows 10 with Python 3.9.12

Requirement already satisfied: idna<4,>=2.5 in c:\users\heather\anaconda3\lib\site-packages (from requests->offlinedatasci) (3.3)                                                                                                               
Installing collected packages: offlinedatasci                                                                           
ERROR: Could not install packages due to an OSError: [WinError 206] The filename or extension is too long: 'C:\\Users\\Heather\\anaconda3\\Lib\\site-packages\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\offlinedatasci'  

or with a different Python instead of the one from Anaconda

Installing collected packages: offlinedatasci                                                                          
ERROR: Could not install packages due to an OSError: [WinError 206] The filename or extension is too long: 'C:\\Users\\Heather\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build\\lib\\build' 

The second one is Python 3.10.4.

@ethanwhite
Copy link
Collaborator

The large number of nest directories \\lib\\build\\lib\\build\\lib\\build... is really weird. Is this behavior exclusive to offlinedatasci or does it happen with other packages?

@hturner
Copy link
Contributor

hturner commented May 7, 2024

It does seem to be specific to offlinedatasci. E.g. pip install rptree and py -m pip install codetiming both work fine, but equivalent commands for offlinedatasci give above error, unless in a virtual environment.

Maybe related to pypa/setuptools#4076?

ethanwhite added a commit to ethanwhite/offlinedatasci that referenced this issue May 7, 2024
setuptools already has a built in system for finding packages. By explicitly finding packages without excludes
we are discovery the build directory and producing infinitely
nested directories when repeatedly installing from the root directory.

Fixes carpentriesoffline#119
@ethanwhite
Copy link
Collaborator

Thanks @hturner! That's super helpful. Based on that I'm guessing that this was an issue with repeated local builds as part of the testing effort. If that's right the #126 should fix the issue. Can you checkout that PR and see if that fixes things for you.

Since I just had to look this up again yesterday for the 42nd time here's how to checkout the PR:

git fetch upstream pull/126/head:test-branch
git switch test-branch

@abhidg
Copy link
Contributor Author

abhidg commented May 7, 2024

@ethanwhite if you have gh installed, you can also do gh pr checkout 126. This only works for GitHub repos though.

@ethanwhite
Copy link
Collaborator

@ethanwhite if you have gh installed, you can also do gh pr checkout 126. This only works for GitHub repos though.

Ooh that is nice!

@ethanwhite ethanwhite reopened this May 8, 2024
@ethanwhite
Copy link
Collaborator

Reopening since we still need someone to confirm that the fixed worked. The fix has now been merged into main so reinstalling from main is all we need for a test.

@ethanwhite ethanwhite added the Awaiting author contribution Waiting on the issue author to do something before proceeding label May 11, 2024
@hturner
Copy link
Contributor

hturner commented May 13, 2024

Reinstalling from main with pip install git+https://git@github.com/carpentriesoffline/offlinedatasci.git works for me.

@ethanwhite
Copy link
Collaborator

Awesome! Thanks @hturner! As soon as we get a couple of other things merged I'll role a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting author contribution Waiting on the issue author to do something before proceeding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants