Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

I want to be able to access my text editor from my bash shell/windows 10

I believe I need to add bash to the path variable. It's not working yet. I tried:

  • typing $PATH into the bash shell
  • copy and pasted that as the environment variable for bash
  • I still only seem to be able to access files in whatever universe bash lives in.
  • I havn't been able to change directories to C in the bash shell, which is where I keep all my python folders

You should look into learning about the BASH terminal vs Windows. Linux handles programs,directories, ... the same way it handles files. Windows on the other hand is object based. Take some time to look into proper syntax for BASH and the difference between Windows and Linux.

Thanks Gerald. I am brushing up on my bash skills. It sounds like your saying I don't need to worry about the environment variable? Cause when that didn't seem to work, I deleted the environment variable that I made.

It sounds like the environment variable you are using has the wrong syntax.

I copy and pasted it from the bash terminal. Although there was something at the end that seemed out of place:

  • I typed in $PATH and I got
  • bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory
  • note the last bit: no such file or directory. Is that supposed to be there? I didn't put it there.

You're using Windows? What is your path variable? I am pretty sure I know the issue

Hi again Gerald. Yes I'm using windows. MS came out with a bash terminal. I had to do a few somersaults to download it. Other than this issue, the bash terminal seems fine. The environment variable I used was the $PATH that I copied from the bash terminal. I'm starting to think that's not what I'm supposed to do?

please give the entire command on one line with a back ticks on either side and the path variable on another line with back ticks on either side.

or better yet do you have team viewer? I can help you out a lot quicker if you want to do this over the phone utilizing team viewer. I will give you my email so we can exchange info if you would like.

bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory

Gerald, I don't use team viewer. I posted the code. It's long...runs off the right edge but it's all there.

You're not understanding what I am asking for

bash@computerr$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory

bash@computerr$ lsblk 

give the output of the last command

You are correct, I am not understanding what you are asking for. So I just copied this from my terminal. I included lsblk. I looked lsblk up, it didn't seem like it would have anything to do with this, but I'm pretty lost right now.

smolderingflax@hello:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory
smolderingflax@hello:~$ lsblk
smolderingflax@hello:~$

Gerald, I appreciate you helping me with this. I work in the morning so I'm heading off to bed. Thank you so much.

We need to check if the file system is mounted and the path for where it is mounted. If lsblk did not return a value try fdisk -l

Hey Gerald, this is what I got for fdisk -l

smolderingflax@hello:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory
smolderingflax@hello:~$ fdisk -l
cannot open /proc/partitions
smolderingflax@hello:~$

run it as sudo

also output cat /etc/fstab

First I have to tell you, I have bee trying to help with this since I downloaded bash. You are the first person that seems both willing and able to help. Thank you.

  • here is sudo fdisk -l
smolderingflax@hello:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory
smolderingflax@hello:~$ sudo fdisk -l
sudo: unable to resolve host hello
[sudo] password for smolderingflax:
cannot open /proc/partitions
smolderingflax@hello:~$
  • here is cat and sudo cat
smolderingflax@hello:~$ cat /etc/fstab
LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
smolderingflax@hello:~$ sudo cat /etc/fstab
sudo: unable to resolve host hello
LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
smolderingflax@hello:~$

Where did you learn this stuff? I'm pretty sure fdisk and fstab are not covered in the treehouse bash/console course I took.

I was going through another resource and it showed this:

smolderingflax@hello:~/projects$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/Intel/TXE Components/TCS:/mnt/c/Program Files/Intel/TXE Components/TCS:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Users/smolderingflax/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/smolderingflax/AppData/Local/Enthought/Canopy/User:/mnt/c/Users/smolderingflax/AppData/Local/Enthought/Canopy/User/Scripts
smolderingflax@hello:~/projects$

I keep forgetting, in the process of downloading flask and trying to get it to work, I ended up using enthought canopy. It got flask to work in it's environment but it changed my python 3.6 to 2.7. I dont really know about echo, but it changed what was printed out for $PATH.

I am a Linux Engineer. The BASH shell is 127.0.0.1 I know very very little about the Windows operating system. So we are kind of learning together. Canonical (which is the company that integrated the BASH environment into Windows) screwed up by giving a file based terminal/scripting lang, to an object based OS.

So by reading the output of fstab it looks like you have one Hard drive in your system, correct? Okay I just read a decent high level article on the situation.

Run the code below and give the output of the second command

sudo apt-get install -y tree
tree /mnt

here is an excerpt from the article however:

Bash tools won’t be able to interact directly with any Windows tools. You can’t run a Bash command from PowerShell, or a Windows command from within Bash.

Here is the article

I installed -y tree and ran tree /mnt. There was an enormous amount of information that was scrolling by for quit a while after running tree /mnt. There is no output from that. When it finished it was just done. I tried running tree /mnt again and I got:

C:\app_a_day>tree /-mnt
Invalid switch - /-mnt

C:\app_a_day>tree -/mnt
Folder PATH listing for volume Windows
Volume serial number is 0000022C 1C5F:96F8
C:\APP_A_DAY\-\MNT
Invalid path - \APP_A_DAY\-\MNT
No subfolders exist

are you still in your BASH terminal? you shouldn't be getting \ for file paths in BASH unless... I hate windows

That's embarrassing, here it is in the bash terminal:

61531 directories, 316307 files
smolderingflax@hello:~$

I had one machine that I installed Ubuntu side by side with windows. I didn't get to work with Ubuntu much cause that machine died. If I installed Ubuntu again, would that resolve a lot of this?