JeyDi / Python-Skeleton

My personal getting started template with Python
MIT License
4 stars 1 forks source link

PermissionError on Windows #1

Open godzail opened 2 years ago

godzail commented 2 years ago

I tried to create a scheleton but I receive this error (on Windows 10):

cookiecutter https://github.com/JeyDi/Python-Skeleton
You've downloaded C:\Users\nicol\.cookiecutters\Python-Skeleton before. Is it okay to delete and re-download it? [yes]:
Select project_type:
1 - Base
2 - Package
3 - FastAPI
4 - Streamlit
5 - DataScience
6 - Mkdocs
Choose from 1, 2, 3, 4, 5, 6 [1]: 4
|---------- "Streamlit" template specific options -----------|
project [python-scheleton]:
author [Andrea Guzzo]:
directory_name [python-scheleton]:
description [Description of the project]:
Select open_source_license:
1 - Not open source
2 - MIT
3 - LGPL3
4 - GPL3
5 - APACHE2
Choose from 1, 2, 3, 4, 5 [1]: 2
Traceback (most recent call last):
  File "C:\Users\nicol\AppData\Local\Temp\tmpl2h5n_ia.py", line 57, in <module>
    os.rename(os.path.join('..', project_type), os.path.join('..', final_dirname))
PermissionError: [WinError 32] Impossibile accedere al file. Il file è utilizzato da un altro processo: '..\\Streamlit' -> '..\\python-scheleton'
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
JeyDi commented 2 years ago

Ciao @godzail molto strano, purtroppo non l'ho ancora mai testato su windows.

Questo comportamento avviene perchè una volta scaricato il file avvengono una serie di controlli per capire quale template stai cercando di utilizzare e quindi il sistema cancella o lascia solamente alcuni files disponibili.

Mi sembra strano però che avvenga questo comportamento, hai provato a controllare se effettivamente la cartella o qualche file non è in uso da qualche altro strumento? Tipo VSCode, IDE o terminal?

Appena riesco faccio anche una prova su windows.

godzail commented 2 years ago

Ciao, ho riprovato a chiudere tutto e lanciare winterminal come amministratore ma stesso risultato... anche disattivando l'antivirus stesso risultato.

Non capisco il messaggio :

Il file è utilizzato da un altro processo: '..\Streamlit' -> '..\python-scheleton'

..perchè se ho ben capito la cartella la sta creando e quindi il file a cui non accede perchè utilizzato quale è?