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 trialLuka Sarich
13,204 PointsAm I writing the cmd line correctly? I am trying to open a .py file with Anaconda..
I'm trying to open a .py file with Anaconda, as shown in the Machine Learning video but I can't figure out why it cannot find the path I'm putting in.
This is my cmd prompt and I know that the .py file is in the machine learning folder. Do I need to do '...' before or what? I am lost!
Luka Sarich
13,204 PointsWhen I go to 'environments' and then open the base with terminal, it wants me to type the path of the file I want to open. So this is what I gave it.
(base) C:\Users\Luka>cd ~/Python/Projects/treehouse/machine_learning/ml.py
And then it says, "The system cannot find the path specified."
Even when I go to my documents and see where the file is the path is Luka > Python > Projects > treehouse > machine_learning > ml.py
So I'm not sure what I'm doing wrong, or an alternative to opening a Python file on Anaconda without the cmd. I tried researching it but couldn't find anything that could help me out.
P.S Thanks for being the best person in the community!! You always somehow answer my questions when nobody else does. Cheers!
Luka Sarich
13,204 PointsI copied and pasted both of those and I still get the same message. Can I move the file somewhere else where it can definitely find it?
Luka Sarich
13,204 PointsYou fixed it! Thanks so much, man, I learned something new today :D
After this ML course I think I'm going to go take the terminal course lol
1 Answer
Steven Parker
231,248 PointsThe "cd" command is only for directories, but this path is to a Python file. Also, I noticed that your prompt has backslashes instead of slashes — so you probably need Windows-style backslashes for separators instead of the Linux style slashes used in the workspaces:
So if you want to change the working directory, use just the directory part of the path:
cd Python\Projects\treehouse\machine_learning
Or, if you want to open the file from where you are:
Python Python\Projects\treehouse\machine_learning\ml.py
I also eliminated the "~/" prefix since you are already in a folder along the path.
Steven Parker
231,248 PointsSteven Parker
231,248 PointsI'm not able to see the image, but you should be able to reproduce a command just by typing it here.