The process cannot access the file because it is being used by another process (windows)
MEMBER
Hi, which version of `nlp` are you using?

By the way we'll be releasing today a significant update fixing many issues (but also comprising a few breaking changes).
You can see more informations here #545 and try it by installing from source from the master branch.
2020-09-09T08:19:12Z
https://github.com/huggingface/datasets/issues/590#issuecomment-689407666
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY4OTQwNzY2Ng==
https://api.github.com/repos/huggingface/datasets/issues/comments/689407666/reactions
2020-09-09T08:19:12Z
https://api.github.com/repos/huggingface/datasets/issues/comments/689407666
https://avatars.githubusercontent.com/u/7353373?v=4
https://api.github.com/users/thomwolf/events{/privacy}
https://api.github.com/users/thomwolf/followers
https://api.github.com/users/thomwolf/following{/other_user}
https://api.github.com/users/thomwolf/gists{/gist_id}
https://github.com/thomwolf
thomwolf
MDQ6VXNlcjczNTMzNzM=
https://api.github.com/users/thomwolf/orgs
https://api.github.com/users/thomwolf/received_events
https://api.github.com/users/thomwolf/repos
https://api.github.com/users/thomwolf/starred{/owner}{/repo}
https://api.github.com/users/thomwolf/subscriptions
User
https://api.github.com/users/thomwolf
public
NONE
I'm using version 0.4.0.


2020-09-09T12:03:29Z
https://github.com/huggingface/datasets/issues/590#issuecomment-689517068
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY4OTUxNzA2OA==
https://api.github.com/repos/huggingface/datasets/issues/comments/689517068/reactions
2020-09-09T12:03:29Z
https://api.github.com/repos/huggingface/datasets/issues/comments/689517068
https://avatars.githubusercontent.com/u/22762845?v=4
https://api.github.com/users/saareliad/events{/privacy}
https://api.github.com/users/saareliad/followers
https://api.github.com/users/saareliad/following{/other_user}
https://api.github.com/users/saareliad/gists{/gist_id}
https://github.com/saareliad
saareliad
MDQ6VXNlcjIyNzYyODQ1
https://api.github.com/users/saareliad/orgs
https://api.github.com/users/saareliad/received_events
https://api.github.com/users/saareliad/repos
https://api.github.com/users/saareliad/starred{/owner}{/repo}
https://api.github.com/users/saareliad/subscriptions
User
https://api.github.com/users/saareliad
public
MEMBER
Ok, it's probably fixed on master. Otherwise if you can give me a fully self-contained exemple to reproduce the error, I can try to investigate.
2020-09-10T07:10:58Z
https://github.com/huggingface/datasets/issues/590#issuecomment-690038207
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY5MDAzODIwNw==
https://api.github.com/repos/huggingface/datasets/issues/comments/690038207/reactions
2020-09-10T07:10:58Z
https://api.github.com/repos/huggingface/datasets/issues/comments/690038207
https://avatars.githubusercontent.com/u/7353373?v=4
https://api.github.com/users/thomwolf/events{/privacy}
https://api.github.com/users/thomwolf/followers
https://api.github.com/users/thomwolf/following{/other_user}
https://api.github.com/users/thomwolf/gists{/gist_id}
https://github.com/thomwolf
thomwolf
MDQ6VXNlcjczNTMzNzM=
https://api.github.com/users/thomwolf/orgs
https://api.github.com/users/thomwolf/received_events
https://api.github.com/users/thomwolf/repos
https://api.github.com/users/thomwolf/starred{/owner}{/repo}
https://api.github.com/users/thomwolf/subscriptions
User
https://api.github.com/users/thomwolf
public
CONTRIBUTOR
I get the same behavior, on Windows, when `map`ping a function to a loaded dataset. 
The error doesn't occur if I re-run the cell a second time though! 
I'm on version 1.0.1.
2020-09-18T12:30:53Z
https://github.com/huggingface/datasets/issues/590#issuecomment-694839433
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY5NDgzOTQzMw==
https://api.github.com/repos/huggingface/datasets/issues/comments/694839433/reactions
2020-09-18T12:31:09Z
https://api.github.com/repos/huggingface/datasets/issues/comments/694839433
https://avatars.githubusercontent.com/u/15801338?v=4
https://api.github.com/users/patpizio/events{/privacy}
https://api.github.com/users/patpizio/followers
https://api.github.com/users/patpizio/following{/other_user}
https://api.github.com/users/patpizio/gists{/gist_id}
https://github.com/patpizio
patpizio
MDQ6VXNlcjE1ODAxMzM4
https://api.github.com/users/patpizio/orgs
https://api.github.com/users/patpizio/received_events
https://api.github.com/users/patpizio/repos
https://api.github.com/users/patpizio/starred{/owner}{/repo}
https://api.github.com/users/patpizio/subscriptions
User
https://api.github.com/users/patpizio
public
MEMBER
This is going to be fixed by #644 
2020-09-18T17:22:04Z
https://github.com/huggingface/datasets/issues/590#issuecomment-694988765
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY5NDk4ODc2NQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/694988765/reactions
2020-09-18T17:22:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/694988765
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
@saareliad I got the same issue that troubled me quite a while. Unfortunately, there are no good answers to this issue online, I tried it on Linux and that's absolutely fine. After hacking the source code, I solved this problem as follows.

In the source code file: arrow_dataset.py -> _map_single(...)

change
```python
if update_data and tmp_file is not None:
    shutil.move(tmp_file.name, cache_file_name)
```
to
```python
tmp_file.close()
if update_data and tmp_file is not None:
    shutil.move(tmp_file.name, cache_file_name)
```

Then it works without needing multiple times runs to avoid the permission error.
I know this solution is unusual since it changes the source code. Hopefully, the lib's contributors can have better solutions in the future.

2020-09-23T23:49:42Z
https://github.com/huggingface/datasets/issues/590#issuecomment-698029681
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY5ODAyOTY4MQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/698029681/reactions
2020-09-23T23:54:46Z
https://api.github.com/repos/huggingface/datasets/issues/comments/698029681
https://avatars.githubusercontent.com/u/23032865?v=4
https://api.github.com/users/wangcongcong123/events{/privacy}
https://api.github.com/users/wangcongcong123/followers
https://api.github.com/users/wangcongcong123/following{/other_user}
https://api.github.com/users/wangcongcong123/gists{/gist_id}
https://github.com/wangcongcong123
wangcongcong123
MDQ6VXNlcjIzMDMyODY1
https://api.github.com/users/wangcongcong123/orgs
https://api.github.com/users/wangcongcong123/received_events
https://api.github.com/users/wangcongcong123/repos
https://api.github.com/users/wangcongcong123/starred{/owner}{/repo}
https://api.github.com/users/wangcongcong123/subscriptions
User
https://api.github.com/users/wangcongcong123
public
NONE
@wangcongcong123 thanks  for sharing.
(BTW I also solved it locally on windows by putting the problematic line under try except and not using cache... On windows I just needed 1% of the dataset anyway)
2020-09-24T03:59:04Z
https://github.com/huggingface/datasets/issues/590#issuecomment-698096994
https://api.github.com/repos/huggingface/datasets/issues/590
MDEyOklzc3VlQ29tbWVudDY5ODA5Njk5NA==
https://api.github.com/repos/huggingface/datasets/issues/comments/698096994/reactions
2020-09-24T03:59:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/698096994
https://avatars.githubusercontent.com/u/22762845?v=4
https://api.github.com/users/saareliad/events{/privacy}
https://api.github.com/users/saareliad/followers
https://api.github.com/users/saareliad/following{/other_user}
https://api.github.com/users/saareliad/gists{/gist_id}
https://github.com/saareliad
saareliad
MDQ6VXNlcjIyNzYyODQ1
https://api.github.com/users/saareliad/orgs
https://api.github.com/users/saareliad/received_events
https://api.github.com/users/saareliad/repos
https://api.github.com/users/saareliad/starred{/owner}{/repo}
https://api.github.com/users/saareliad/subscriptions
User
https://api.github.com/users/saareliad
public
Hi, I consistently get the following error when developing in my PC (windows 10):

```
    train_dataset = train_dataset.map(convert_to_features, batched=True)
  File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map
    shutil.move(tmp_file.name, cache_file_name)
  File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move
    os.unlink(src)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1'

```