Pandas not installed

I have installed Anaconda individual as per the tutorial getting started …i see Pandas’ how ever when i do import panda as pd there is error message no Panda’s installed

Please provide support

3 Likes

I am having the same problem. I can install a package within the IDE or run the program from Anaconda prompt but when I try run the program from a command prompt window I get an error that the module cannot be found.

1 Like

I am having the same problem. I can install a package within the IDE or run the program from Anaconda prompt but when I try run the program from a command prompt window I get an error that the module cannot be found.

2 Likes

I managed to resolve this. The issue is an environment issue when you are running from the command prompt and not a package issue.

You don’t need to understand how to work with environments for this solve but it will help to have a basic understanding of what they are. I’ve broken down the steps for a complete beginner as I was when I ran into this problem first.

Because python was installed through Anaconda, you need to activate the Anaconda base environment in the command prompt before running a python program. In simple terms this tells your system where to locate all the files you need, such as the python.exe file and the various packages you installed. You will need to do this every time you try run a python program through the command prompt so the best way to do it is to create a .bat file (an executable file that runs multiple lines of code of in the command prompt). You can then just double click that file and it will run your python program.

Lets say you are wanting to run a program called myProgram.py

  1. Create a new text file, change the name of the file to run.bat
  2. Right click and edit the file. Save the below text written between the dashed lines into the file (do not include the dashed lines):

call “C:\Users\YourName\anaconda3\condabin\activate.bat”
“C:\Users\YourName\anaconda3\python.exe” “C:\Users\YourName\myProgram.py”

  • Your will need to change the first part of the path to suit your own system but if you installed Anaconda & python with the default settings you should just have to change YourName to whatever your system is.
  • The first line will active the Conda environment.
  • The second line calls the python exe and then calls the program.
  1. Close the run.bat file
  2. Double click the run.bat file to run it. It will then run your python program through a normal command prompt.

If you are just wanting to run a single python program from the command line once, its much simpler to just run it in the Anaconda Prompt. But if you wanting to be able to run specific programs regularly outside of your IDE by just double clicking it or adding them in the task scheduler, then this is the way I found works best.

Hope this helps, let me know if I can make anything clearer

2 Likes

I have what I believe to be the same issue, i.e., unactivated conda environment. (pip install and conda install are not recognized from the DOS prompt or in PyCharm). Will your solution to fix the problem in the base environment and allow me to run a python program in PyCharm? My ultimate goal is to use Python Backtrader but I’m unable to install it. I’m hoping that activating Anaconda will enable me to achieve that end. Thank you for your patience.

2 Likes

No it won’t. You will have to set up PyCharm to run in Anaconda environment, which unfortunately I am not familiar with. I’d suggest looking into the path manager of PyCharm

1 Like

On mine, Pandas is installed but it wont let me upgrade it to the 2.0 version. will doing this help me?? @Alex_Black

2 Likes