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

Put all data into a sub-directory? #2702

Closed
htgoebel opened this issue Jul 26, 2017 · 3 comments · Fixed by #7713
Closed

Put all data into a sub-directory? #2702

htgoebel opened this issue Jul 26, 2017 · 3 comments · Fixed by #7713
Labels
kind:to be discussed Please add our opionon and rational @low pull-request wanted Please submit a pull-request for this, maintainers will not actively work on this.

Comments

@htgoebel
Copy link
Member

rm -rf build/ dist/
echo "import pytz" > test.py
pyinstaller.py test.py --clean --name pytz

crashes with

8898 INFO: Building COLLECT because out00-COLLECT.toc is non existent
8898 INFO: Building COLLECT out00-COLLECT.toc
Traceback (most recent call last):
…
  File "…/Python.framework/Versions/3.5/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
NotADirectoryError: [Errno 20] Not a directory: '/private/tmp/pyinst/dist/pytz/pytz/zoneinfo'

This is caused by the executable having the same name as the data-directory (pytz). See #2697.

The only solution I can think about is to put all data into some sub-directory. Then the name of this sub-directory could be make configurable. I'm not clear in my mind about the implications of such a change.

@htgoebel htgoebel added @low pull-request wanted Please submit a pull-request for this, maintainers will not actively work on this. kind:to be discussed Please add our opionon and rational labels Jul 26, 2017
@kratzert
Copy link

Was having the same problem and want to add that it seems like this is only an issue on Linux (maybe macOS, can't test this) but not on Windows (at least Win 10). I'm comparing similar Python environments, so this shouln't be any issue.

@marioortizmanero
Copy link

This will happen when both the generated binary and the directory you want to create have the same name. In Unix, there can't be a directory and a file with the same name at once, so it prints an error.

@nathanielmanistaatgoogle

I've also encountered this - with PyInstaller 4.0, working on macOS or Linux, and the codebase expanded from this sdist the command python -m PyInstaller --onedir --add-data="representative/util/resource.txt:representative/util" --name=representative representative/__main__.py hits a NotADirectoryError because of the conflict between naming the executable dist/representative/representative and needing to have a directory named dist/representative/representative/util. Since "representative" is the natural name for the executable (the sdist can be installed in a Python environment and after it is it is callable with python -m representative) it really seems like the directory in which the resource resides ought find some way to "budge" and exist at some other path in the output.

@bwoodsend bwoodsend linked a pull request Jul 10, 2023 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:to be discussed Please add our opionon and rational @low pull-request wanted Please submit a pull-request for this, maintainers will not actively work on this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants