Pandas installation with all dependencies - python

i am new to python. i am using python 3.7 and installed pandas using pip. when i checked for pandas version i found all the dependencies are not installed . so i read somewhere anaconda installation will install all the dependent packages. so i have installed anaconda still when i search for python version it shows that packages are not installed
Pandas version image
i am using visual studio code for programming python
i want to use pandas with full functionality
can someone help me on this installation
thank you

The process I follow:
Install anaconda from this link https://www.anaconda.com/distribution/
Add the Anaconda program directory to your Path environment variable. See here > https://www.quora.com/How-can-I-add-conda-command-into-the-PATH-environment-variable-so-that-it-recognizes-the-instruction-given-that-the-executable-program-is-already-installed
Sometimes you may also need to add ".....Anaconda3\Library\bin" as well.
Open command prompt and type "conda install pandas", to install pandas.
This has always worked for me.

Related

pip install of pandas

I have recently attempted to install pandas through pip. It appears to go through the process of installing pandas and all dependencies properly. After I update to the latest version through cmd as well and everything appears to work; typing in pip show pandas gives back information as expected with the pandas version showing as 1.5.3
However, it appears that when attempting to import pandas to a project in PyCharm (I am wondering if this is where the issue lies) it gives an error stating that it can't be found. I looked through the folders to make sure the paths were correct and that pip didn't install pandas anywhere odd; it did not.
I uninstalled python and installed the latest version; before proceeding I would like to know if there is any reason this issue has presented itself. I looked into installing Anaconda instead but that is only compatible with python version 3.9 or 3.1 where as I am using the newest version, 3.11.2
When this happens to me
I reload the environment variables by running the command
source ~/.bashrc
right in the pycharm terminal.
I make sure the I have activated the correct venv (where the package installations go) by cd to path_with_venv then running
source ~/pathtovenv/venv/bin/activate
If that does not work, hit CMD+, to open your project settings and and under Python Interpreter select the one with the venv that you have activated. Also check if pandas appears on the list of packages that appear below the selected interpreter, if not you may search for it and install it using this way and not the pip install way

Vscode cant find my installed pip libraries. How can i get my pip libraries used in vscode on linux mint?

I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.
which python
Gives the output: /usr/bin/python
I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get
the installed libraries.
when i use the terminal outside of vscode and do
pip list
I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.
I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.
It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder
Can anyone please help?
I've found the problem.
In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.
For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:
sudo apt install /Downloads/{name of downloaded.deb file}
When I used this version of Visual studio code it all worked for me with no problem.

Not able to work with Miniconda on Windows 10

I have been trying to use a Conda Environment and I am working with Python 3.10.2. I want to install Pandas and SciPy through Miniconda. I downloaded it but when I tried running conda install pandas on the command prompt it says that "Conda is not recognised as an internal or an external command, a program or a batch file'. What could have gone wrong?
Can you also suggest an alternate way to download Pandas?
Conda probably wasn't added as a path variable. Locate the conda.exe add it to the path.
Can you also suggest an alternate way to download Pandas?
You could use pip:
pip install pandas

Installing SciPy for Python 3.7 on Mac Os High Sierra

please help installing SciPy. I think i've tried almost any advice i could find, but still no luck.
I am using Mac High OS Sierra 10.13.1, python 3.7, trying to make this work for IntellIJ IDEA 2017.2 IDE. I have Xcode version 9.2 if that helps.
I've tried instaling from IDE, using package installer -> fails with error status code 1.
I've tried installing using pip3 install scipy
I've installed brew install gcc ( I have version 7.2.0 installed)
I've installed numpy.
I've tried to install using Macports as suggested on official site - didn't help.
I've tried to instal using brew install scipy.
I've tried to install using Conda. It installed somewhere to Conda Dir, but i still cannot access library from python file using import scipy, error: No module named scipy.
Looks like i am just going in loops now, can some one suggest any idea please?
Topics i researched:
SciPy build/install Mac Osx
Can't install Scipy through pip
"failed with error code 1" while installing scipy
Some other ones i lost links to.
Ok looks like i made it work.
This thread: helped me.
It appeared I was actaully able to install scipy package using conda. But my Python didn't see the package. So i had to:
Change Right Click on my project in IDE > Project > New > Python SDK > Add Local
Select Python in Conda dir. In my case it was /Users/[my user ]/miniconda3/bin/python3.6
Restart IDE just in case and my python script was able to see import scipy.
The downside of this - that I cannot install packages the clean way from IDE anymore for some reason. I.e. Tools > Manage Python Packages > + > doesn't find any. And I have to reinstall all the packages i had using conda install [package name] from terminal . But I am fine with it, as long as it works.
Hopefully my quest might be useful for someone.

How to delete extra pythons on Mac OS X Sierra

In the usr/bin folder, there are three versions of Pythons installed: Python, Python2.6, Python2.7 (the folder names) - not sure what version is for Python folder.
My issue, originally, was that I tried to install the module 'pandas' to run a script, python keeps telling me pandas could not be found.
'pip freeze' shows me pandas is already installed.
However, I could not find pandas using python>>help>>modules.
So I suspected there are multiple pythons installed causing pip installing for one of them, but the default python is a different one.
So my questions are -
1 Which python is the default one that comes with macOS Sierra? (I can confirm pandas currently is installed for Python, not Python2.6 or Python2.7)
2 Can I remove extra Pythons that do not have pandas?
3 How can I find what it the default Python when I type 'Python...' and how to install pandas for that python?
Solved:
Thanks for the comments and reply.
I used "python2.7 install pip" to install pip for python2.7. Then I used command 'pip2.7 install pandas'. This way, pandas is installed for the default python. (The command 'pip install pandas' on my machine, is installing for python 2.6.)
macOS Sierra uses Python 2.7 by default.
You can uninstall a version of Python as described here. However, you shouldn't need to as long as you are managing your packages and environments. If you want to maintain more control over your projects and their packages/versions, you should take a look at virtualenv. Virtualenv creates environments that have their own installation directories that don't share packages with other virtualenv environments. This is a very popular option many people use when managing projects.
You can use pip --version to see which version of Python you are installing a package for. You can also use pip list to see which packages are currently installed.
I highly recommend taking a look at virtualenv as it'll make keeping track of Python environments and their respective packages a lot easier.
Hope this helps!

Categories