Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dazed and confused...
#1
Hello everyone! Rod here with a new account saying "Hi!" and looking to fix a little problem I am having as I setup to learn this new programming thing called, Python. I hope everyone is doing well and ready to enjoy their Summer.

I took a Python class this past semester and did well, but now must prepare for a more advanced course but no longer have my Ubuntu laptop (wife bought me a Microsoft Surface), so I am using Windows 10 Pro and hitting a wall with this .py stuff.

I installed Python36 to C:\Python36 and inside this folder created a folder titled, 'Exercises' to test myself with some exercise codes out there, but when I try to run the saved file, 'HelloWorld.py' from Windows 10 Pro PowerShell, it shows this an error message (http ://i.imgur.com/CCX9BhU.jpg).

As you can see Python is working, but I cannot run the .py. I have my PATH setup correctly (at least it looks that way), but since I am not used to Windows 10 I am not sure if I am doing any of this correctly. My attempts to fix this on the web have failed, thus here I am.

Any Windows 10 experts able to get me back on the correct PATH?

Sent from my Sheikah Slate,

-Rod
Reply
#2
(May-27-2017, 04:57 AM)RodNintendeaux Wrote: PowerShell, it shows this an error message (http://i.imgur.com/CCX9BhU.jpg).
Don't post picture,post error in code tag BBcode help
$ is used in Terminal Linux,it's only python Helloworld.py

Quote:Any Windows 10 experts able to get me back on the correct PATH?
Look at part-1
Quote:from Windows 10 Pro PowerShell,
Don't use Powershell,look at part-2 and use cmder.
Reply
#3
First, I wouldn't put your 'personal' scripts in the same directory as the Python install. Make a new directory, say C:\python. Next right click on the 'Start' button, select 'Run' type in 'cmd.exe', this will open the command terminal. Type 'python' and hit 'Enter'. You should see something similar to :

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
If you do, you're environment is set up correctly. Type exit() to exit python. Navigate to where your file is, for example: cd c:\python . Type in your 'filename'.py and it should display your output (if written correctly)
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#4
I apologize about the picture, it would not let me cut or copy from PowerShell. I love portable applications so I will add cmder to my thumb drive and give it a shot. Thanks for the information. I will not be able to get on until tonight to try this, I will let you know if I run into any issues.

Looking at the cmder documentation I am not sure what it is telling me about the add cmder to ?. I will have to look into this deeper and more effectively later.

Thanks again, I truly appreciate your advice.

Sent from my Sheikah Slate,

-Rod
Reply
#5
(May-27-2017, 01:24 PM)sparkz_alot Wrote: If you do, you're environment is set up correctly. Type exit() to exit python. Navigate to where your file is, for example:  cd c:\python . Type in your 'filename'.py and it should display your output (if written correctly)

@sparkz_alot It works. The environment is working, I was not using the cd:\python\exercises, only using cd:\python\. My .py files are recognized and running fine.

I love the Cmder you all recommended. Especially the lower-Lamda in front of each line. However, I have run into a problem with the Part-1 setup:

First, the
C:\Windows\System32>cd\
kicks out (yes, I did "exit()" first)
Error:
c:\Windows\System32 λ cd c:\windows\system32>cd Access is denied.
I do not know why.

Second, the c:\>pip -V kicks out an error,
Error:
c:\python λ c:\>pip -V 'c:\' is not recognized as an internal or external command, operable program or batch file.
I use both administrator cmd and Cmder and both fail. Did I miss something in the initial setup? I have double-checked my work and all seems to be done correctly.

If anyone can point me to the right place where I messed this up please do, I will do my best to get it done.

Sent from my Sheikah Slate,
-Rod
Reply
#6
You have not setup correctly.
Dos python command work?
Eg:
C:\Users\Tom
λ cd\

C:\
λ python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\
λ pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

C:\
λ
Easiest to uninstall,follow all images in part-1
Remember to restart pc.
Then try commands as showed over,
if still dos not work you can have messed up environment Variables Path.
Then can show how to fix manually.

Run cmder always as admin:
[Image: pp2wmH.jpg]
Reply
#7
I don't use 'cmdr' so I can't speak to that or how it's set up. Try pip -V from the command terminal. (Note: it shouldn't matter what directory you're in). Also, it could be 'pip' is not installed. You might try:

python -m ensurepip
if it is installed, you will see something like this:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>python -m ensurepip
Requirement already satisfied: setuptools in c:\python36\lib\site-packages
Requirement already satisfied: pip in c:\python36\lib\site-packages
Requirement already satisfied: packaging>=16.8 in c:\python36\lib\site-packages (from setuptools)
Requirement already satisfied: six>=1.6.0 in c:\python36\lib\site-packages (from setuptools)
Requirement already satisfied: appdirs>=1.4.0 in c:\python36\lib\site-packages (from setuptools)
Requirement already satisfied: pyparsing in c:\python36\lib\site-packages (from packaging>=16.8->setuptools)

C:\>
If it is not installed, it will install it. If it ends up installing it, type:

pip install --upgrade pip
This will bring it up to the latest version.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#8
(May-27-2017, 10:21 PM)sparkz_alot Wrote: I don't use 'cmdr' so I can't speak to that or how it's set up.
Command work exactly as the same as cmd,just that cmder has a lot more commands that work.
cmd is still there cmder dos not overwrite cmd,so can use that to.
Will of course not use ugly cmd again,if use cmder  Wink
Reply
#9
Wow, I missed the "restart PC" in Part I. An oversight on my part. When I run python -m ensurepip I get all requirements satisfied. pip install --upgrade pip prints out requirement is already up-to-date. pip -V prints out pip 9.0.1 from c:\python\lib\site-packages (python 3.6).

Note: "C:\Windows\System32>cd\" outputs "The filename, directory name, or volume label syntax is incorrect." Do I even need this command anymore since pip and python are working?

I guess the only thing I am missing now is learning this virtual environment stuff. It looks promising, but I have not used virtualenv in any of my schooling or self-teachings so this is a new attempt. I will research further to see how it works and how to get it purring in Win10.

Thank you all, this has been a great learning opportunity for me. I truly appreciate all of your advice and assistance getting this up and running.

Sent from my Sheikah Slate,
-Rod
Reply
#10
(May-27-2017, 08:02 PM)RodNintendeaux Wrote: However, I have run into a problem with the Part-1 setup:

First, the
C:\Windows\System32>cd\
kicks out (yes, I did "exit()" first)
Error:
c:\Windows\System32 λ cd c:\windows\system32>cd Access is denied.
I do not know why.

Second, the c:\>pip -V kicks out an error,
Error:
c:\python λ c:\>pip -V 'c:\' is not recognized as an internal or external command, operable program or batch file.

1) The slash is important, so you need to write cd \ and not merely just cd in order to change your path to root. See also 2) for what to (not) include in your command

2) Cmder shows a different prompt, but the normal Windows shell will show you the current path as prompt, so the c:\> part is not part of your command, you simply need to type pip -V

If you want to learn more about this windows shell details, these are basic DOS commands (and Linux as well sometimes), for example the > symbol has a specific meaning you don't need. It is just part of the prompt and shown for comparison, not to be typed by you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  String int confused janeik 7 1,053 Aug-02-2023, 01:26 AM
Last Post: deanhystad
  I am confused with the key and value thing james1019 3 944 Feb-22-2023, 10:43 PM
Last Post: deanhystad
  Pandas confused DPaul 6 2,532 Sep-19-2021, 06:45 AM
Last Post: DPaul
  is and '==' i'm confused hshivaraj 6 2,678 Sep-15-2021, 09:45 AM
Last Post: snippsat
  Confused with 'flags' tester_V 10 4,874 Apr-12-2021, 03:03 AM
Last Post: tester_V
  Simple Tic Tac Toe but I'm confused Izith 1 2,181 Sep-26-2020, 04:42 PM
Last Post: Larz60+
  I am really confused with this error. Runar 3 2,986 Sep-14-2020, 09:27 AM
Last Post: buran
  Confused on how to go about writing this or doing this... pythonforumuser 3 2,472 Feb-10-2020, 09:15 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020