Error writing lock file on Bash/nano using Python on Windows 10

0

I use

$ sudo nano first.py

or

$ nano first.py

to start a new nano file (in Python), while using Bash on Windows 10, but the file won't save.

The error I get when I try to save the file is:

[ Error while writing first.py: Access denied ]

Any ideas? I cannot find answers anywhere on the Internet.

Χριστιανίδης Βασίλειος

Posted 2017-09-24T07:28:12.143

Reputation: 1

1(1) As a matter of nomenclature, you’re not starting a new nano file in Python, you’re creating a new Python file in nano.  (2) More importantly, what directory are you in when you do this?  Does a first.py file already exist?  What happens if you type > first.py? Please do not respond in comments; [edit] your question to make it clearer and more complete. – Scott – 2017-09-24T12:19:26.200

Answers

0

There might be an issue with the Ubuntu installation in Windows. I had similar issues and a reinstall helped. Try reinstalling Ubuntu on Windows

To reinstall:

Run PowerShell as Administrator and then

lxrun /uninstall

Press "y". And then reinstall with

lxrun /install

Press "y". It takes about 10 min to reinstall. Hope that helps.

Gy Tis

Posted 2017-09-24T07:28:12.143

Reputation: 11