failed in "sudo pip install ggplot" - python

Happy new year,
I tried to install the ggplot on my ubuntu 14.04 and got the following error message (code)
my verson of python-dev 2.7.5-5ubuntu3.
I have already did the following
sudo apt-get update
sudo apt-get upgrade gcc
sudo apt-get install python2.7-dev
william#ubuntu:~$ sudo pip install ggplot
[sudo] password for william:
Downloading/unpacking ggplot
Downloading ggplot-0.6.5.tar.gz (8.4MB): 8.4MB downloaded
Running setup.py (path:/tmp/pip_build_root/ggplot/setup.py) egg_info for package ggplot
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python3/dist-packages (from ggplot)
Downloading/unpacking statsmodels (from ggplot)
Downloading statsmodels-0.6.1.tar.gz (7.0MB): 7.0MB downloaded
Running setup.py (path:/tmp/pip_build_root/statsmodels/setup.py) egg_info for package statsmodels
/bin/sh: 1: svnversion: not found
/bin/sh: 1: svnversion: not found
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [enabled by default]
int exp (void);
^
_configtest.o: In function `main':
/tmp/easy_install-1xuwcszp/numpy-1.9.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [enabled by default]
int exp (void);
^
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
Running from numpy source directory.
/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/system_info.py:1526: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/system_info.py:1432: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/statsmodels/setup.py", line 449, in <module>
**setuptools_kwargs)
File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 262, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 618, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 870, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 882, in obtain
return installer(requirement)
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 338, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 613, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 643, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 833, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 1055, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 1040, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 114, in run
return func()
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 67, in runner
_execfile(setup_script, ns)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 43, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/setup.py", line 251, in <module>
self._clean_exclude = ["bspline_ext.c",
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/setup.py", line 243, in setup_package
"""Custom distutils command to clean the .so and .pyc files."""
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/egg_info.py", line 10, in run
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 153, in run
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 170, in build_sources
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 329, in build_extension_sources
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 386, in generate_sources
File "numpy/core/setup.py", line 432, in generate_config_h
File "numpy/core/setup.py", line 42, in check_types
File "numpy/core/setup.py", line 293, in check_types
if not os.path.exists(src):
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
non-existing path in 'numpy/distutils': 'site.cfg'
non-existing path in 'numpy/f2py': 'docs'
non-existing path in 'numpy/f2py': 'f2py.1'
non-existing path in 'numpy/lib': 'benchmarks'
_configtest.o: In function `main':
/tmp/easy_install-1xuwcszp/numpy-1.9.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
Complete output from command python setup.py egg_info:
/bin/sh: 1: svnversion: not found
/bin/sh: 1: svnversion: not found
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [enabled by default]
int exp (void);
^
_configtest.o: In function `main':
/tmp/easy_install-1xuwcszp/numpy-1.9.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [enabled by default]
int exp (void);
^
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
Running from numpy source directory.
/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/system_info.py:1526: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/system_info.py:1432: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/statsmodels/setup.py", line 449, in <module>
**setuptools_kwargs)
File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 262, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 618, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 870, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources.py", line 882, in obtain
return installer(requirement)
File "/usr/local/lib/python3.4/dist-packages/setuptools/dist.py", line 338, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 613, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 643, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 833, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 1055, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/easy_install.py", line 1040, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 114, in run
return func()
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 67, in runner
_execfile(setup_script, ns)
File "/usr/local/lib/python3.4/dist-packages/setuptools/sandbox.py", line 43, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/setup.py", line 251, in <module>
self._clean_exclude = ["bspline_ext.c",
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/setup.py", line 243, in setup_package
"""Custom distutils command to clean the .so and .pyc files."""
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.4/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/egg_info.py", line 10, in run
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 153, in run
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 170, in build_sources
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 329, in build_extension_sources
File "/tmp/easy_install-1xuwcszp/numpy-1.9.1/numpy/distutils/command/build_src.py", line 386, in generate_sources
File "numpy/core/setup.py", line 432, in generate_config_h
File "numpy/core/setup.py", line 42, in check_types
File "numpy/core/setup.py", line 293, in check_types
if not os.path.exists(src):
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
non-existing path in 'numpy/distutils': 'site.cfg'
non-existing path in 'numpy/f2py': 'docs'
non-existing path in 'numpy/f2py': 'f2py.1'
non-existing path in 'numpy/lib': 'benchmarks'
_configtest.o: In function `main':
/tmp/easy_install-1xuwcszp/numpy-1.9.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/statsmodels
Storing debug log for failure in /home/william/.pip/pip.log
william#ubuntu:~$
Many thanks for your help

This is a common error when you're missing the python-dev package. You can install it using:
sudo apt-get install python-dev
Try installing after you have this package.
Edit:
As the other answer mentioned, to get python-dev for python 3:
sudo apt-get install python3-dev

From the paths in that log, it could be that your pip is installing this for Python 3. python-dev won't do in that case, you'd need package python3-dev to get Python.h for Python 3.

Related

Error while pip installing scipy 0.19.1 : "don't know how to compile Fortran code on platform"?

I get a very large error log when i am trying to install scipy 0.19.1 (it is needed by a project i am trying to run) and I'm actually not sure which part is the main error because there seem to be many errors happening:
C:\Users\John>pip install scipy==0.19.1
Collecting scipy==0.19.1
Using cached https://files.pythonhosted.org/packages/52/67/d9ef9b5058d4a9e3f0ae641ec151790622cbeb37f157de5773358e2bf3da/scipy-0.19.1.tar.gz
Complete output from command python setup.py egg_info:
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Processing numpy/random\mtrand.pyx
Processing numpy/random\_bounded_integers.pyx.in
Processing numpy/random\_common.pyx
Processing numpy/random\_generator.pyx
Processing numpy/random\_mt19937.pyx
Processing numpy/random\_pcg64.pyx
Processing numpy/random\_philox.pyx
Processing numpy/random\_sfc64.pyx
Cythonizing sources
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable g95
Could not locate executable efort
Could not locate executable efc
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
non-existing path in 'numpy\\distutils': 'site.cfg'
Running from numpy source directory.
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\system_info.py:1914: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
if self._calc_info(blas):
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\system_info.py:1914: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
if self._calc_info(blas):
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\system_info.py:1914: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
if self._calc_info(blas):
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\system_info.py:1748: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
return getattr(self, '_calc_info_{}'.format(name))()
C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\system_info.py:1748: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
return getattr(self, '_calc_info_{}'.format(name))()
c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
yield saved
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
yield
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 278, in run
return func()
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\setup.py", line 508, in <module>
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\setup.py", line 500, in setup_package
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\core.py", line 169, in setup
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\egg_info.py", line 24, in run
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 144, in run
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 155, in build_sources
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 288, in build_library_sources
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 378, in generate_sources
File "numpy\core\setup.py", line 663, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\John\AppData\Local\Temp\pip-build-9ky_jp3j\scipy\setup.py", line 416, in <module>
setup_package()
File "C:\Users\John\AppData\Local\Temp\pip-build-9ky_jp3j\scipy\setup.py", line 412, in setup_package
setup(**metadata)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 1134, in obtain
return installer(requirement)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 1101, in run_setup
run_setup(setup_script, args)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 251, in run_setup
raise
File "c:\users\John\appdata\local\programs\python\python36\lib\contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
yield
File "c:\users\John\appdata\local\programs\python\python36\lib\contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 169, in save_modules
saved_exc.resume()
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 144, in resume
six.reraise(type, exc, self._tb)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
yield saved
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
yield
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 278, in run
return func()
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 246, in runner
_execfile(setup_script, ns)
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\setup.py", line 508, in <module>
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\setup.py", line 500, in setup_package
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\core.py", line 169, in setup
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\John\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\egg_info.py", line 24, in run
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\John\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 144, in run
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 155, in build_sources
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 288, in build_library_sources
File "C:\Users\John\AppData\Local\Temp\easy_install-wq9y_09v\numpy-1.19.4\numpy\distutils\command\build_src.py", line 378, in generate_sources
File "numpy\core\setup.py", line 663, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\John\AppData\Local\Temp\pip-build-9ky_jp3j\scipy\
You are using pip version 8.1.1, however version 20.2.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
at first it was giving me errors about not finding Cython, so i installed it, not this is happening, how can i solve it?
my python version is 3.6.1, and pip version is 8.1.1, both of which is needed by the project so i don't think i can change them.

Python pip 8.1.1 upgrade failing

I am currently on pip version 8.1.1 and trying to upgrade a package:
root#NetworkAutomation-1:~# pip3 install -U netmiko
But I am receiving this error:
Collecting netmiko
Using cached https://files.pythonhosted.org/packages/26/05/dbe9c97c39f126e7b8dc70cf897dcad557dbd579703f2e3acfd3606d0cee/netmiko-2.4.2-py2.py3-none-any.whl
Collecting paramiko>=2.4.3 (from netmiko)
Using cached https://files.pythonhosted.org/packages/06/1e/1e08baaaf6c3d3df1459fd85f0e7d2d6aa916f33958f151ee1ecc9800971/paramiko-2.7.1-py2.py3-none-any.whl
Collecting setuptools>=38.4.0 (from netmiko)
Using cached https://files.pythonhosted.org/packages/f9/d3/955738b20d3832dfa3cd3d9b07e29a8162edb480bf988332f5e6e48ca444/setuptools-44.0.0-py2.py3-none-any.whl
Collecting textfsm (from netmiko)
Using cached https://files.pythonhosted.org/packages/bd/27/0b149b6da3e47cc8daebace6920093114392171a8f5c24f1f2ad9a9e9c4d/textfsm-1.1.0-py2.py3-none-any.whl
Collecting scp>=0.13.2 (from netmiko)
Using cached https://files.pythonhosted.org/packages/4d/7a/3d76dc5ad8deea79642f50a572e1c057cb27e8b427f83781a2c05ce4e5b6/scp-0.13.2-py2.py3-none-any.whl
Collecting pyserial (from netmiko)
Using cached https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl
Collecting cryptography>=2.5 (from paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/be/60/da377e1bed002716fb2d5d1d1cab720f298cb33ecff7bf7adea72788e4e4/cryptography-2.8.tar.gz
Collecting pynacl>=1.0.1 (from paramiko>=2.4.3->netmiko)
Using cached https://files.pythonhosted.org/packages/61/ab/2ac6dea8489fa713e2b4c6c5b549cc962dd4a842b5998d9e80cf8440b7cd/PyNaCl-1.3.0.tar.gz
Complete output from command python setup.py egg_info:
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
File "/usr/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/usr/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.5/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.5/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 161, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 147, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 23, in run
self.build()
File "/usr/lib/python3.5/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run
_build_ext.run(self)
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
self.build_extensions()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 174, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/lib/python3.5/distutils/command/build_ext.py", line 532, in build_extension
depends=ext.depends)
File "/usr/lib/python3.5/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python3.5/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-473w7z52/cffi-1.13.2/setup.py", line 248, in <module>
"Programming Language :: Python :: Implementation :: PyPy",
File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1087, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 246, in run_setup
raise
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-473w7z52/cffi-1.13.2/setup.py", line 248, in <module>
"Programming Language :: Python :: Implementation :: PyPy",
File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-d9hokmzc/pynacl/setup.py", line 255, in <module>
"Programming Language :: Python :: 3.7",
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 663, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 873, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1101, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1089, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-d9hokmzc/pynacl/
You are using pip version 8.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root#NetworkAutomation-1:~#
it seems like your gcc is not working not configured correctly.
command 'x86_64-linux-gnu-gcc' failed with exit status 1
Please make sure that your gcc is up to date. If this is not working out try to run pip in verbose mode with the --verbose flag. May you can figure out the error in that way otherwise you need to figure out what does the gcc error causes.
You output clearly says:
c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
You have to do this:
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
or refer to this link for other OS beside Ubuntu:
fatal error: Python.h: No such file or directory

What do I need to download before downloading matplotlib? I am getting the error below

This is what i get for an error. I have checked my updates, tried pip3 still same error. I have also tried to run command prompt as administrator. Is there something else I need to install before getting matplotlib?
ERROR: Command errored out with exit status 1:
command: 'c:\users\broc\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\broc\\AppData\\Local\\Temp\\pip-install-dapj3ew6\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\broc\\AppData\\Local\\Temp\\pip-install-dapj3ew6\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\broc\AppData\Local\Temp\pip-install-dapj3ew6\matplotlib\pip-egg-info'
cwd: C:\Users\broc\AppData\Local\Temp\pip-install-dapj3ew6\matplotlib\
Complete output (198 lines):
================================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [3.1.1]
python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC
v.1916 32 bit (Intel)]]
platform: yes [win32]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
agg: yes [installing]
tkagg: yes [installing; run-time loading from Python Tcl/Tk]
macosx: no [Mac OS-X only]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable g95
Could not locate executable efort
Could not locate executable efc
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
'svnversion' is not recognized as an internal or external command,
operable program or batch file.
non-existing path in 'numpy\\distutils': 'site.cfg'
Running from numpy source directory.
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\setup.py:419: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\system_info.py:690: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
self.calc_info()
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\system_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\system_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\system_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\system_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\bdist_egg.py", line 163, in run
self.run_command("egg_info")
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\egg_info.py", line 26, in run
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\build_src.py", line 142, in run
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\build_src.py", line 153, in build_sources
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\build_src.py", line 286, in build_library_sources
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\build_src.py", line 369, in generate_sources
File "numpy\core\setup.py", line 667, in get_mathlib_info
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\command\config.py", line 241, in try_link
self._check_compiler()
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\command\config.py", line 54, in _check_compiler
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 171, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 1075, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 547, in __init__
vc_ver or self._find_latest_available_vs_ver())
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 561, in _find_latest_available_vs_ver
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\setup.py", line 444, in <module>
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\setup.py", line 436, in setup_package
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\core.py", line 171, in setup
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
raise
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
saved_exc.resume()
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\setup.py", line 444, in <module>
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\setup.py", line 436, in setup_package
File "C:\Users\broc\AppData\Local\Temp\easy_install-90gtdhd8\numpy-1.17.4\numpy\distutils\core.py", line 171, in setup
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\broc\AppData\Local\Temp\pip-install-dapj3ew6\matplotlib\setup.py", line 262, in <module>
setup(
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 717, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
return installer(requirement)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 787, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:\users\broc\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1146, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am not sure what I have to do to download this. I have been searching for hours trying to find the solution.

Pip installing Keras -- Command "python setup.py egg_info"

I'm trying to install Keras but having diffuculty. I have looked at similar threads and tried their solutions but none seemed to work. I have tried the following:
pip install keras
pip install unroll
both returning the same results as shown below:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Ahmad\AppData\Local\Temp\pip-build-6qx6kw9h\unroll\
Also here is the output when I pip Install Keras:
C:\Users\Ahmad\Desktop\HouseProject>pip install keras
Collecting keras
Collecting theano (from keras)
Requirement already satisfied: pyyaml in c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages (from keras)
Requirement already satisfied: six in c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages (from keras)
Collecting scipy>=0.14 (from theano->keras)
Using cached scipy-0.19.1.tar.gz
Complete output from command python setup.py egg_info:
non-existing path in 'numpy\\distutils': 'site.cfg'
Running from numpy source directory.
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\setup.py:367: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\system_info.py:572: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\system_info.py:572: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site- packages\setuptools\msvc.py", line 481, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site- packages\setuptools\command\bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\command\egg_info.py", line 26, in run
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\command\build_src.py", line 148, in run
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy- 1.13.1\numpy\distutils\command\build_src.py", line 159, in build_sources
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\build_src.py", line 294, in build_library_sources
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\build_src.py", line 377, in generate_sources
File "numpy\core\setup.py", line 672, in get_mathlib_info
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\command\config.py", line 243, in try_link
self._check_compiler()
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\config.py", line 51, in _check_compiler
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\_msvccompiler.py", line 197, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site- packages\setuptools\msvc.py", line 176, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site- packages\setuptools\msvc.py", line 835, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\msvc.py", line 477, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\msvc.py", line 484, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 158, in save_modules
yield saved
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
yield
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 49, in _execfile
exec(code, globals, locals)
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 392, in <module>
# higher up in this file.
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 384, in setup_package
if "--force" in sys.argv:
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\core.py", line 169, in setup
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1104, in run_setup
run_setup(setup_script, args)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 257, in run_setup
raise
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
yield
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 170, in save_modules
saved_exc.resume()
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 145, in resume
six.reraise(type, exc, self._tb)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 158, in save_modules
yield saved
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
yield
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 49, in _execfile
exec(code, globals, locals)
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 392, in <module>
# higher up in this file.
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 384, in setup_package
if "--force" in sys.argv:
File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\core.py", line 169, in setup
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\setup.py", line 416, in <module>
setup_package()
File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\setup.py", line 412, in setup_package
setup(**metadata)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 325, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 446, in fetch_build_eggs
replace_conflicting=True,
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 855, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 1127, in best_match
return self.obtain(req, installer)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 1139, in obtain
return installer(requirement)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 518, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 672, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 698, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 879, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1118, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1106, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\
I dont know if this helps but this is whats inside my pip list:
backports.weakref (1.0rc1)
beautifulsoup4 (4.6.0)
bleach (1.5.0)
bs4 (0.0.1)
certifi (2017.7.27.1)
chardet (3.0.4)
distribute (0.7.3)
ez-setup (0.9)
html5lib (0.9999999)
idna (2.5)
inflection (0.3.1)
Markdown (2.6.8)
more-itertools (3.2.0)
pandas (0.20.3)
pip (9.0.1)
protobuf (3.3.0)
python-dateutil (2.6.1)
pytz (2017.2)
PyYAML (3.12)
Quandl (3.2.0)
requests (2.17.3)
scikit-learn (0.18.2)
setuptools (36.2.7)
six (1.10.0)
sklearn (0.0)
tensorflow (1.2.1)
urllib3 (1.21.1)
Werkzeug (0.12.2)
wheel (0.29.0)
whenever I installed Visual studio again I received this error.
Command "c:\users\ahmad\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Ahmad\\AppData\\Local\\Temp\\pip-build-si1p7x2k\\scipy\\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\Ahmad\AppData\Local\Temp\pip-zrxmip_u-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\
Thanks for the help By the way!!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 416, in <module>
setup_package()
File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 412, in setup_package
setup(**metadata)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 336, in configuration
config.add_subpackage('scipy')
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\setup.py", line 15, in configuration
config.add_subpackage('linalg')
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
caller_level = 2)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
caller_level = caller_level + 1)
File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "scipy\linalg\setup.py", line 20, in configuration
raise NotFoundError('no lapack/blas resources found')
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
I fixed the problem... It was because I wasn't using anaconda. I uninstalled and reinstalled using anaconda and it worked :)

Docker unable to install numpy, scipy, or gensim

I am trying to build a Docker application that uses Python's gensim library, version 2.1.0, which is being installed via pip from a requirements.txt file.
However, Docker seems to have trouble installing numpy, scipy, and gensim. I googled the error messages and found other users who experienced the same problem, but in other environments. Many of their solutions do not seem to work in Docker.
The following is the error message:
<pre> Step 4 : RUN pip install -r requirements.txt
---> Running in a86d07e229d7
Collecting Flask==0.12 (from -r requirements.txt (line 1))
Downloading Flask-0.12-py2.py3-none-any.whl (82kB)
Collecting requests==2.17.3 (from -r requirements.txt (line 2))
Downloading requests-2.17.3-py2.py3-none-any.whl (87kB)
Collecting numpy==1.12.1 (from -r requirements.txt (line 3))
Downloading numpy-1.12.1.zip (4.8MB)
Collecting nltk==3.2.2 (from -r requirements.txt (line 4))
Downloading nltk-3.2.2.tar.gz (1.2MB)
Collecting scipy==0.19.0 (from -r requirements.txt (line 5))
Downloading scipy-0.19.0.zip (15.3MB)
Complete output from command python setup.py egg_info:
/bin/sh: svnversion: not found
/bin/sh: svnversion: not found
non-existing path in 'numpy/distutils': 'site.cfg'
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable lf95
Could not locate executable pgfortran
Could not locate executable f90
Could not locate executable f77
Could not locate executable fort
Could not locate executable efort
Could not locate executable efc
Could not locate executable g77
Could not locate executable g95
Could not locate executable pathf95
don't know how to compile Fortran code on platform 'posix'
Running from numpy source directory.
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/setup.py:367: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/system_info.py:572: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/system_info.py:572: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/system_info.py:572: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/system_info.py:572: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
/usr/local/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 48, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/setup.py", line 392, in <module>
# higher up in this file.
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/setup.py", line 384, in setup_package
if "--force" in sys.argv:
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/core.py", line 169, in setup
File "/usr/local/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/site-packages/setuptools/command/bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "/usr/local/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/local/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 159, in build_sources
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 294, in build_library_sources
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 674, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-j8py_tat/scipy/setup.py", line 416, in <module>
setup_package()
File "/tmp/pip-build-j8py_tat/scipy/setup.py", line 412, in setup_package
setup(**metadata)
File "/usr/local/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python3.5/site-packages/setuptools/dist.py", line 320, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/local/lib/python3.5/site-packages/setuptools/dist.py", line 377, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 852, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1124, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1136, in obtain
return installer(requirement)
File "/usr/local/lib/python3.5/site-packages/setuptools/dist.py", line 445, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 699, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 880, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1119, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1105, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 257, in run_setup
raise
File "/usr/local/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/local/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 170, in save_modules
saved_exc.resume()
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 145, in resume
six.reraise(type, exc, self._tb)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 199, in setup_context
yield
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python3.5/site-packages/setuptools/sandbox.py", line 48, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/setup.py", line 392, in <module>
# higher up in this file.
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/setup.py", line 384, in setup_package
if "--force" in sys.argv:
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/core.py", line 169, in setup
File "/usr/local/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/site-packages/setuptools/command/bdist_egg.py", line 152, in run
self.run_command("egg_info")
File "/usr/local/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/local/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 159, in build_sources
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 294, in build_library_sources
File "/tmp/easy_install-ocgjhe9m/numpy-1.13.0/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 674, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program
/bin/sh: gcc: not found
/bin/sh: gcc: not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j8py_tat/scipy/
Removing intermediate container a86d07e229d7
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1 </pre>
I'm using the python:3.5-alpine image. The versions of the packages are numpy==1.12.1, scipy==0.19.0, and gensim==2.1.0.
To install numpy, scipy, or gensim, the following lines need to be added to the Dockerfile before RUN pip install -r requirements.txt:
RUN apt-get -y install libc-dev
RUN apt-get -y install build-essential
RUN pip install -U pip
The first two lines install the C build tools required for the libraries. The tihrd line upgrades pip to the newest available version.

Categories

Resources