This question already has an answer here:
- Why does this work in the Python IDLE shell but not when I run it as a Python script from the command prompt? 4 answers
- Python csv import fails 2 answers
as said in the title I'm having problem runnig my code from cmd which is working just fine in python shell.
I have py2neo version 4.
here is my code:
from py2neo import Graph
print ("passed")
here is the output from python shell:
passed
>>>
here is the output from cmd command:
D:\py2neo>python py2neo.py
Traceback (most recent call last):
File "py2neo.py", line 1, in <module>
from py2neo import Graph
File "D:\ALI\Desktop\ayten\mine-py2neo\py2neo.py", line 1, in <module>
from py2neo import Graph
ImportError: cannot import name 'Graph'
I've been searching, the answer out there were the different versions of python that I have on my system, which has cause this problem. But I checked that out and realized that both of them have the same version.
here is how i figured out the versions:
opening the python shell:
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
in cmd:
D:\py2neo>python --version
Python 3.6.4
D:\py2neo>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Thank you in advance.