简体   繁体   中英

bash on Ubuntu on windows Linux, folder recognition, and running Python scripts

I'm new to Linux. I recently downloaded Bash on Ubuntu on Windows 10 (after the Anniversary edition update to Windows 10). Since this update is relatively new, there is not much online regarding troubleshooting. There are two things I need help on:

(1) When I go to the home folder, which seems to be "C:\\Users\\user\\AppData\\Local\\lxss\\home\\user\u0026quot; and I add a new folder through Windows, this folder does not show up in Linux with the "ls" command. But when I add a directory using "mkdir" in Linux, the "ls" command shows this folder. Why is it behaving like this? Am I limited to creating folders through "mkdir" when working in this folder?

(2) I have a Python script sitting in that same folder that I'm trying to run and again it is not being found by Linux or the Python interpreter started in Bash on Ubuntu on Windows. I have Python 3 installed (Anaconda) and I'm able to type commands directly in the Python interpreter and it's working. However, I would like to run scripts in files.

Please let me know if more information is needed. Thanks.

The reason why ls is not showing anything is that it shows the Linux directory structure. Try setting it to the Windows directory, in this example the c drive:

cd /mnt/c

Does ls show a folder structure now?

Looks like you are having permissions issues. To see everything on your home folder try ls -al to change permissions check out the chmod command

How about using Python for Windows and NotePad++ to edit and run your Python scripts? https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe

You can setup NotePad++ as described here. How to Execute a Python File in Notepad ++?

(I ended up using Cloud9 https://c9.io/ for Python. It is independent of your local environment or OS)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM