11

I am trying to install the pandas package in pycharm. I get the following error: unable to find vcvarsall.bat (i tried to install via the cmd but also via the project interpreter). I tried to install WSDK according to here but it did not work. I also tried the instructions in the video. Lastly i tried downloading the gcc binary according.

None of these worked. Any ideas ? I am using Windows 10, my python version is 3.4.1 and the pip version is 1.5.6 (for 64-bit)

quant
  • 4,062
  • 5
  • 29
  • 70
  • Have you tried `pip install pandas` ? It should use the wheel and circumvent interpreters. The error you get is related to compiling: "vcvarsall.bat" is part of the compiler in Visual Studio that is necessary to compile the module. Also...pip 1.5.6? The latest pip versions are at version 9 or 10, not 1 ... try upgrading pip first – Uvar Aug 07 '17 at 14:13
  • @Uvar I get the same error both from cmd and the`pycharm`. How can i upgrade the pip ? – quant Aug 07 '17 at 14:23

6 Answers6

28

Try python -m pip install --upgrade pip followed by pip install pandas, or python -m pip install pandas.

SabreWolfy
  • 5,392
  • 11
  • 50
  • 73
Uvar
  • 3,372
  • 12
  • 25
  • I am receiving this error: ERROR: Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. – Naga May 03 '22 at 05:17
13

If you are on latest PyCharm 2018 then follow the below steps to install:

MAC:

Click on PyCharm shown on the Menu bar -> Click Preferences -> Click Project Interpreter under your Project -> Click '+' -> search for 'pandas'/'numpy' (you can specify specific version you want to install) and Click install underneath. Now you're done.

Skadoosh
  • 141
  • 1
  • 10
12

Open terminal from View -> Tool Windows -> Terminal type command:

pip install pandas

Upon successful installation you should see output like so:

Successfully installed numpy-1.14.3 pandas-0.23.0 python-dateutil-2.7.3 pytz-2018.4 six-1.11.0

Then from File → Settings → Project: YourProjectName → Project Interpreter check that under project interpreter pandas package installed.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Hamed Nikzad
  • 618
  • 8
  • 14
5

Easiest way to do this is install anaconda on your machine. Then fire up your pycharm >> go to new project >> then you are given with 2 option - one is to select folder and the second one is to select interpreter .

Select interpreter as the directory where you have installed anaconda then go to settings, there you find something available packages then search for the package you wish you install and press install package and you are good to go.

This is the list you will get , just click on the one you want to install and hit install package at the bottom of dialog box.

enter image description here

0

Just write your program, use pandas library. import pandas -> under pandas you will see red lines. Hover your mouse there you will see install option just click it and wait for few minutes.

0
import requests
from bs4 import BeautifulSoup
import pandas as pd


def get_netology_posts():
    res = requests.get('https://netology.ru/blog/')
    soup = BeautifulSoup(res.text, features="html.parser")
    posts = soup.find_all('div', class_='posts__item')

    netology_posts = pd.DataFrame()

    for post in posts:
        title = post.find('a', class_='posts__link').text
        link = post.find('a', class_='posts__link').get('href')
        date = post.find('div', class_='posts__date').text
        category = post.find('span').text
        netology_posts = netology_posts._append({'title': title, 'link': link, 'date': date, 'category': category}, ignore_index=True)

    return netology_posts

print(get_netology_posts())

почему не выводит 'link': link, 'date': date?

Sergey
  • 1
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Gugu72 Jul 18 '23 at 20:22