ModuleNotFoundError: No module named 'py'
up vote
-3
down vote
favorite
I'm a beginner studying Python for the first time, So plz be patient with my stupid codes.
I'm writing a code in Pycharm Editor for module exercises.. My code is
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
def fib2(n):
result=
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return result
And I want to import this module in python interpreter, but I have this error here!
Traceback (most recent call last):
File "", line 1, in
File "C:Program FilesJetBrainsPyCharm Community Edition 2018.2.4helperspydev_pydev_bundlepydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'py'
I think there might be a problem in pythonpath .. But I have no idea about it.
My python interpreter and pycharm files are in a different path.
python pythonpath
|
show 2 more comments
up vote
-3
down vote
favorite
I'm a beginner studying Python for the first time, So plz be patient with my stupid codes.
I'm writing a code in Pycharm Editor for module exercises.. My code is
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
def fib2(n):
result=
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return result
And I want to import this module in python interpreter, but I have this error here!
Traceback (most recent call last):
File "", line 1, in
File "C:Program FilesJetBrainsPyCharm Community Edition 2018.2.4helperspydev_pydev_bundlepydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'py'
I think there might be a problem in pythonpath .. But I have no idea about it.
My python interpreter and pycharm files are in a different path.
python pythonpath
2
What's yourimport
statement?
– Mayank Porwal
Nov 20 at 4:29
1
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09
|
show 2 more comments
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I'm a beginner studying Python for the first time, So plz be patient with my stupid codes.
I'm writing a code in Pycharm Editor for module exercises.. My code is
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
def fib2(n):
result=
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return result
And I want to import this module in python interpreter, but I have this error here!
Traceback (most recent call last):
File "", line 1, in
File "C:Program FilesJetBrainsPyCharm Community Edition 2018.2.4helperspydev_pydev_bundlepydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'py'
I think there might be a problem in pythonpath .. But I have no idea about it.
My python interpreter and pycharm files are in a different path.
python pythonpath
I'm a beginner studying Python for the first time, So plz be patient with my stupid codes.
I'm writing a code in Pycharm Editor for module exercises.. My code is
def fib(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
def fib2(n):
result=
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return result
And I want to import this module in python interpreter, but I have this error here!
Traceback (most recent call last):
File "", line 1, in
File "C:Program FilesJetBrainsPyCharm Community Edition 2018.2.4helperspydev_pydev_bundlepydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'py'
I think there might be a problem in pythonpath .. But I have no idea about it.
My python interpreter and pycharm files are in a different path.
python pythonpath
python pythonpath
edited Nov 20 at 4:27
lagom
3,41661737
3,41661737
asked Nov 20 at 4:23
Jin Kwon
1
1
2
What's yourimport
statement?
– Mayank Porwal
Nov 20 at 4:29
1
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09
|
show 2 more comments
2
What's yourimport
statement?
– Mayank Porwal
Nov 20 at 4:29
1
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09
2
2
What's your
import
statement?– Mayank Porwal
Nov 20 at 4:29
What's your
import
statement?– Mayank Porwal
Nov 20 at 4:29
1
1
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53386190%2fmodulenotfounderror-no-module-named-py%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
What's your
import
statement?– Mayank Porwal
Nov 20 at 4:29
1
Possible duplicate of Python: 'import node.py' raises "No module named py"-error
– MisterMiyagi
Nov 20 at 6:01
@MisterMiyagi Nop I tried everything there :(
– Jin Kwon
Nov 22 at 6:01
@MayankPorwal import py
– Jin Kwon
Nov 22 at 6:02
So your own module is called ˋpyˋ and the error occurs when you try to import it? How do you run it?
– MisterMiyagi
Nov 22 at 7:09