Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to install pandas using pip

While installing pandas using pip, I'm getting error. Can someone please help me out with fixing this issue. I'm using python 3.4 on windows10.

set build\lib.win-amd64-3.4\pandas/_version.py to '0.22.0'
    running build_ext
    building 'pandas._libs.hashing' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 743, in <module>
        **setuptools_kwargs)
      File "C:\Python34\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Python34\lib\distutils\command\install.py", line 539, in run
        self.run_command('build')
      File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\distutils\command\build.py", line 126, in run
        self.run_command(cmd_name)
      File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 385, in build_extensions
        build_ext.build_extensions(self)
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 161, in build_extensions
        _build_ext.build_extensions(self)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 448, in build_extensions
        self.build_extension(ext)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
        self.initialize()
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python34\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
        return unpatched['query_vcvarsall'](version, *args, **kwargs)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']

    ----------------------------------------
Command "C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sthakur1\\AppData\\Local\\Temp\\pip-build-2lweg8a9\\pandas\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\sthakur1\AppData\Local\Temp\pip-todgu5lt-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\
like image 716
Sandie Avatar asked Oct 28 '22 15:10

Sandie


2 Answers

Have you tried running your CMD window as an administrator? And try this instead:

python -m pip install pandas

Also make sure that your python installation folder is in your 'PATH' Environment Variable

like image 69
Thomas Goodyear Avatar answered Nov 08 '22 19:11

Thomas Goodyear


This turned out to be a common issue while instaling pandas with pip on python 3.4. That's actually a known bug confirmed by pandas package developers on https://github.com/pandas-dev/pandas/issues/20775

The simplest solution should be:

pip install 'pandas<0.21'
like image 34
KonnovArt Avatar answered Nov 08 '22 20:11

KonnovArt