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 IDLE in a Virtual Environment

Using PowerShell commands 'cat', 'rm', 'pip -r' in command shell

Like others I wanted to follow along with the videos but decided I wanted to use the Command Shell instead, not wanting to change the execution policy in the PowerShell.

As others have noted in previous years there seem to be a few discrepancies between the shells. Those queries appear to be quite old so I thought I would make this just in case anyone does this course and was a bit stuck like I was.

In the video we see Kenneth Love using the following commands:

cat .\requirements.txt to view the contents in the file requirements.txt, which is a list of the packages and their respective package versions to be installed.

rm fb which removed the 'fb' file from the directory

pip -r .\requirements.txt which recovered the packages from the requirements.txt file Unfortunately, for whatever reason, none of these appeared to work in the command shell.

As mentioned in this forum: https://teamtreehouse.com/community/this-series-needs-an-overhaul-its-very-badly-done

cat can be replaced with type in the command shell which functions essentially the same. type .\requirements.txt works just fine.

As discussed in this forum: https://teamtreehouse.com/community/i-get-rm-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file

rmdir fb is part of the solution to rm fb, but as mentioned gives the error "The directory is not empty". The full solution that I found is rmdir /s ".\fb". To be honest, I don't fully yet understand why this solves it, but you can read more about /s here: https://stackoverflow.com/questions/9866962/what-is-cmd-s-for

During my own attempt at following along but in the Command shell, I was also stumped at pip -r .\requirements.txt which gave the error message:

Usage:
  pip <command> [options]

no such option: -r

After a bit of digging I came across the solution of pip install -r .\requirements.txt which is discussed here: https://pip.pypa.io/en/stable/user_guide/ I've not dug too deep with this, but perhaps this is just a different method for command shell or maybe an updated command with pip 20.1.1 as of writing this. Either way, that worked for me.

It's not much, but if you're like me and want things to work, I hope this helps!

Rachel Johnson
Rachel Johnson
Treehouse Teacher

Brilliant breakdown! Thanks for contributing and helping others in the community.