Python Forum
Running script from Anaconda prompt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running script from Anaconda prompt
#1
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  No Internet connection when running a Python script basil_555 8 581 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 469 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Help Running Python Script in Mac OS emojistickers 0 339 Nov-20-2023, 01:58 PM
Last Post: emojistickers
  Trying to make a board with turtle, nothing happens when running script Quascia 3 658 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  Python script running under windows over nssm.exe JaroslavZ 0 704 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Running script with subprocess in another directory paul18fr 1 3,713 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  Anaconda pip install mpyc Error pip-script.py is not present Anldra12 2 7,824 Dec-13-2021, 06:59 PM
Last Post: Anldra12
  Automatic user/password entry on prompt by bash script PBOX_XS4_2001 3 2,764 May-18-2021, 06:42 PM
Last Post: Skaperen
  Running script on multiple files Afrodizzyjack 1 2,509 May-14-2021, 10:49 PM
Last Post: Yoriz
  Error when running script on startup in Linux NoahTheNerd 0 1,956 Mar-07-2021, 04:54 PM
Last Post: NoahTheNerd

Forum Jump:

User Panel Messages

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