Python Forum
Running script from Anaconda prompt - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Running script from Anaconda prompt (/thread-27642.html)



Running script from Anaconda prompt - acollins555 - Jun-15-2020

I have Anaconda3 running with Python 3.6.10 and everything works fine. I was able to use Spyder to write and test the code. I can also run simple one file script like "hello world" from the command prompt.

Now I want to run this program that I wrote from the Anaconda Powershell Prompt without the overhead of Spyder debugger. I have 4 files and they are all in the same directory. 3 of the files are imported into the file where main() resides. In my file with main(), called xscan.py, I try to do "from xtree import ...." where xtree.py is the file with other code I get ImportError. Obviously Anaconda is not looking in the local Windows folder for these files. I did try sys.path.append in xscan.py but that didn't do any good. What do I have to do to run this program from the Anaconda command prompt? Thanks.

Removing .py suffix fixed it.