• Register
1 vote
516 views

Problem:

Hello,

Python learning is being hard for me. I just about to start running my very first python program. I’ve installed a fresh python set-up on my machine and done writing my first program.

print  "Hello Python!"

However, the program is not running in my case and producing an error:

can't find '__main__' module in ''

Why does the problem occur? How can I get out of this? I am looking forward to having a legit solution for it.

Thanks,

12 7 7
15,250 points

Please log in or register to answer this question.

1 Answer

1 vote

Solution:

Well, the error message indicates that you don’t have a valid python file to build in this particular program. So, make sure you saved your program with a .py extension. After then, on the ‘Tools/Build System’ menu, make sure your build system is set to either ‘auto’ or ‘Python

I think you should read the python documentation very clearly before giving it a clinical start. You, do have to have strong knowledge of a certain programming language before starting it. Go here and read the documentation first.

In the latest python version, you have to use parenthesis in a print function. You want to do something like this

print ("Hello World!");

Good Day!

13 9 6
94,260 points

Related questions

0 votes
1 answer 7 views
7 views
Problem: Looking at the Python install, it gives the error: modulenotfounderror: no module named '_sqlite3.' Now, do I need to reinstall Python, or is there another way to get this module up and running?
asked Apr 18 anika11 32.2k points
0 votes
1 answer 11 views
11 views
Question: I have installed python 3.3.2 and pygame 1.9.2a0. Whenever I try to import pygame by typing: import pygame I get following error message : Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32 Type " ... 'pygame' >>> I went through some of the questions related to this error but none of the solution helped. I have 64 bit machine with Win7 OS
asked Apr 14 munim01 21k points
1 vote
1 answer 14 views
14 views
Problem : During my learning I faced this , please help me how to fix it.
asked Mar 24 PkGuy 23.5k points
0 votes
1 answer 34 views
34 views
Problem: how to I Solve this: modulenotfounderror: no module named '_sqlite3' HELP! I need help understanding this: modulenotfounderror: no module named '_sqlite3' Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 10 Mashhoodch 13k points
0 votes
1 answer 20 views
20 views
Problem: How to I Solve this: error loading mysqldb module no module named mysqldb HELP! I need help understanding this: error loading mysqldb module no module named mysqldb Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 5 Mashhoodch 13k points
0 votes
1 answer 24 views
24 views
Problem: How to I Solve this: modulenotfounderror: no module named 'seaborn' HELP! I need help understanding this: modulenotfounderror: no module named 'seaborn' Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 5 Mashhoodch 13k points
0 votes
1 answer 15 views
15 views
Problem: Why I got the error : modulenotfounderror: no module named 'pip._internal' How to fix this erro: modulenotfounderror: no module named 'pip._internal' HELP! I need help understanding this error: modulenotfounderror: no module named 'pip._internal' Any ideas on what I need to do to fix this? Thanks!
asked Feb 28 Mashhoodch 13k points
0 votes
1 answer 98 views
98 views
Problem: Tried running a file with the following imports: from flask_sqlalchemy import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker Received the following error: ImportError: No module named 'flask_sqlalchemy' SQLAlchemy is installed. Still, I tried to reinstall into the directory in which it will be used.
asked Feb 23 Mashhoodch 13k points
0 votes
1 answer 117 views
117 views
Problem: have troubles to import the basemap module of mpl_toolkits in python. Here is what I get when I run the test.py script from the module directory: /usr/lib/python2.7/dist-packages/mpl_toolkits/basemap$ python test.py Traceback (most recent call last): File "test. ... " directory. There is no problem to import mpl_toolkits. Here is a thing I tried, to manually add the path, and the result:
asked Feb 14 Mashhoodch 13k points
0 votes
1 answer 135 views
135 views
Problem: I am using Ubuntu and have installed Python 2.7.5 and 3.4.0. In Python 2.7.5 I am able to successfully assign a variable x = Value('i', 2), but not in 3.4.0. I am getting: Traceback (most recent call last): File "<stdin>", line 1, ... File "/usr/local/lib/python3.4/ctypes/__init__.py", line 7, in <module> from _ctypes import Union, Structure, Array ImportError: No module named '_ctypes'
asked Jan 26 Mashhoodch 13k points