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

flit --symlink: FileExistsError: [WinError 183] Cannot create a file when that file already exists: #584

Open
dougransom opened this issue Aug 24, 2022 · 2 comments

Comments

@dougransom
Copy link

sometimes I see an error
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\Doug\\dictation toolbox\\natlinkcore\\src\\natlinkcore' -> 'C:\\Program Files (x86)\\Python39-32\\Lib\\site-packages\\natlinkcore'

when running flit install --symlink' after a pip uninstall`.

Here you can see there is no package in site-packages named natlinkcore. I run a build and install and seeing the error.

`PS C:\Users\Doug\dictation toolbox\natlinkcore> ls 'C:\Program Files (x86)\Python39-32\Lib\site-packages\n*'

Directory: C:\Program Files (x86)\Python39-32\Lib\site-packages

Mode LastWriteTime Length Name


d----- 5/20/2022 11:54 AM numpy
d----- 5/20/2022 11:54 AM numpy-1.22.3.dist-info

PS C:\Users\Doug\dictation toolbox\natlinkcore> flit build
Found 115 files tracked in git I-flit.sdist
Built sdist: dist\natlinkcore-5.2.3.tar.gz I-flit_core.sdist
Copying package file(s) from C:\Users\Doug\AppData\Local\Temp\tmpxsoyl83k\natlinkcore-5.2.3\src\natlinkcore I-flit_core.wheel
Writing metadata files I-flit_core.wheel
Writing the record of files I-flit_core.wheel
Built wheel: dist\natlinkcore-5.2.3-py3-none-any.whl I-flit_core.wheel
PS C:\Users\Doug\dictation toolbox\natlinkcore> flit install --symlink
Extras to install for deps 'all': {'.none', 'test'} I-flit.install
Installing requirements I-flit.install
Requirement already satisfied: pysimplegui>=4.60.3 in c:\program files (x86)\python39-32\lib\site-packages (from -r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 1)) (4.60.3)
Requirement already satisfied: pyenvutils in c:\program files (x86)\python39-32\lib\site-packages (from -r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 2)) (1.0.0.2)
Requirement already satisfied: pydebugstring in c:\users\doug\appdata\roaming\python\python39\site-packages (from -r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 3)) (0.0.0.2)
Requirement already satisfied: dtactions>=1.5.0 in c:\program files (x86)\python39-32\lib\site-packages (from -r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.5.2)
Requirement already satisfied: pytest>=7.1.2 in c:\program files (x86)\python39-32\lib\site-packages (from -r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (7.1.2)
Requirement already satisfied: debugpy in c:\users\doug\appdata\roaming\python\python39\site-packages (from dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.6.0)
Requirement already satisfied: pywin32>=300 in c:\program files (x86)\python39-32\lib\site-packages (from dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (304)
Collecting natlinkcore
Using cached natlinkcore-5.2.1-py3-none-any.whl (154 kB)
Requirement already satisfied: dragonfly2 in c:\program files (x86)\python39-32\lib\site-packages (from dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (0.35.0)
Requirement already satisfied: tomli>=1.0.0 in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (2.0.1)
Requirement already satisfied: pluggy<2.0,>=0.12 in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (1.0.0)
Requirement already satisfied: attrs>=19.2.0 in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (22.1.0)
Requirement already satisfied: colorama in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (0.4.5)
Requirement already satisfied: iniconfig in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (1.1.1)
Requirement already satisfied: py>=1.8.2 in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (1.11.0)
Requirement already satisfied: packaging in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (21.3)
Requirement already satisfied: atomicwrites>=1.0 in c:\users\doug\appdata\roaming\python\python39\site-packages (from pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (1.4.1)
Requirement already satisfied: lark-parser==0.8.* in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (0.8.9)
Requirement already satisfied: pyperclip>=1.7.0 in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.8.2)
Requirement already satisfied: requests in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (2.27.1)
Requirement already satisfied: regex in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (2022.4.24)
Requirement already satisfied: Werkzeug in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (2.1.2)
Requirement already satisfied: six in c:\program files (x86)\python39-32\lib\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.16.0)
Requirement already satisfied: json-rpc in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.13.0)
Requirement already satisfied: setuptools>=40.0.0 in c:\program files (x86)\python39-32\lib\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (58.1.0)
Requirement already satisfied: decorator in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (5.1.1)
Requirement already satisfied: comtypes in c:\users\doug\appdata\roaming\python\python39\site-packages (from dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.1.11)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\doug\appdata\roaming\python\python39\site-packages (from packaging->pytest>=7.1.2->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 5)) (3.0.9)
Requirement already satisfied: wxPython==4.1.1 in c:\program files (x86)\python39-32\lib\site-packages (from natlinkcore->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (4.1.1)
Requirement already satisfied: pillow in c:\program files (x86)\python39-32\lib\site-packages (from wxPython==4.1.1->natlinkcore->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (9.1.1)
Requirement already satisfied: numpy in c:\program files (x86)\python39-32\lib\site-packages (from wxPython==4.1.1->natlinkcore->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.22.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\doug\appdata\roaming\python\python39\site-packages (from requests->dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (2022.5.18.1)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\doug\appdata\roaming\python\python39\site-packages (from requests->dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\doug\appdata\roaming\python\python39\site-packages (from requests->dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in c:\users\doug\appdata\roaming\python\python39\site-packages (from requests->dragonfly2->dtactions>=1.5.0->-r C:\Users\Doug\AppData\Local\Temp\tmppbjstc_prequirements.txt (line 4)) (3.3)
Installing collected packages: natlinkcore
Successfully installed natlinkcore-5.2.1
Symlinking src\natlinkcore -> C:\Program Files (x86)\Python39-32\Lib\site-packages\natlinkcore I-flit.install
Traceback (most recent call last):
File "C:\Program Files (x86)\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files (x86)\Python39-32\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python39-32\Scripts\flit.exe_main
.py", line 7, in
File "C:\Program Files (x86)\Python39-32\lib\site-packages\flit_init
.py", line 192, in main
Installer.from_ini_path(args.ini_file, user=args.user, python=python,
File "C:\Program Files (x86)\Python39-32\lib\site-packages\flit\install.py", line 430, in install
self.install_directly()
File "C:\Program Files (x86)\Python39-32\lib\site-packages\flit\install.py", line 324, in install_directly
os.symlink(src.resolve(), dst)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\Doug\dictation toolbox\natlinkcore\src\natlinkcore' -> 'C:\Program Files (x86)\Python39-32\Lib\site-packages\natlinkcore'
PS C:\Users\Doug\dictation toolbox\natlinkcore>`

Note I previously had a natlinkcore but i uninstalled it.

@dougransom
Copy link
Author

workaround with pip install -e .

@takluyver
Copy link
Member

Symlinks on Windows still don't seem to 'just work' the way they do on Linux & Mac - the --pth-file option is there mostly as a fallback for Windows.

I'll leave this open for now to see if anyone has any good ideas, but I don't have any easy way to investigate it, so I'm not going to do anything further at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants