close

How to use Anaconda Python to execute a .py file?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to use Anaconda Python to execute a .py file? in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to use Anaconda Python to execute a .py file?

  1. How to use Anaconda Python to execute a .py file?

    You should use Anaconda Prompt instead of common Windows command prompt. Then navigate to your folder with the .py file and run:

  2. use Anaconda Python to execute a .py file

    You should use Anaconda Prompt instead of common Windows command prompt. Then navigate to your folder with the .py file and run:

Method 1

You should use Anaconda Prompt instead of common Windows command prompt. Then navigate to your folder with the .py file and run:

 python myfile.py

However if you want to use normal command prompt you should put the path with you’re python.exe which is usually in

C:\Users\<username>\AppData\Local\Continuum\anaconda3\python.exe

behind this one put your .py file.

Method 2

Launch JupyterLab from Anaconda (Perform the following operation with JupyterLab …)

Click on icon folder in side menu

Start up “Text File”

Rename untitle.txt to untitle.py (The name of the file started up was also changed)

Start up the “terminal” (In windows the power shell starts up)

Execute the command python untitle.py

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read