Installing Python Scikit-Learn - python

I'm running the command "pip3 install scikit-learn", and the command prompt spits out the following error:
reading manifest file 'scikit_learn.egg-info\SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\setup.py", line 270, in <module>
setup_package()
File "C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\setup.py", line 266, in setup_package
setup(**metadata)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\core.py", line 171, in setup
return old_setup(**new_attr)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\install.py", line 62, in run
r = self.setuptools_run()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 557, in run
self.run_command(cmd_name)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install_egg_info.py", line 34, in run
self.run_command('egg_info')
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\numpy\distutils\command\egg_info.py", line 19, in run
_egg_info.run(self)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 279, in run
self.find_sources()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
mm.run()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 533, in run
self.add_defaults()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 569, in add_defaults
self.read_manifest()
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\sdist.py", line 201, in read_manifest
self.filelist.append(line)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\egg_info.py", line 475, in append
path = convert_path(item)
File "c:\users\nathanholt\appdata\local\programs\python\python36-32\lib\distutils\util.py", line 125, in convert_path
raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/home/andy/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h' cannot be absolute
Command "c:\users\nathanholt\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\NATHAN~1\\AppData\\Local\\Temp\\pip-build-l0z1x7if\\scikit-learn\\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\NATHAN~1\AppData\Local\Temp\pip-7iz3ig6v-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\NATHAN~1\AppData\Local\Temp\pip-build-l0z1x7if\scikit-learn\"
I know my numpy+MKL and Scipy are both up to date, along with my C++ Redistributable. Any idea what could cause this?

Install it from here http://www.lfd.uci.edu/~gohlke/pythonlibs/ . If you use python 3.6 and win64 download scikit_umfpack‑0.2.3‑cp36‑cp36m‑win_amd64.whl this one.

Can you try with Anaconda? https://www.continuum.io/downloads#windows
After installing anaconda you can create a virtual environment with conda:
conda create -n myenv python=3.5
After that you will activate the evn
source activate myenv
(myenv)$ conda install scikit-learn
This works for me

Related

Unable to install stable-baselines3[extra] using pip in Python 3.7

I am trying to install stable-baselines3[extra] using pip install stable baselines3[extra] but it ends up with the error mentioned below. I am using:
User Current Version:- 3.7.13 (default, Apr 24 2022, 01:06:43)
GCC 11.2.0]
On Ubuntu 22.04 in PyCharm as well as Jupyter Notebook. In Google Colab, it installs without any error. What might be the issue?
Here is the python version in Google Colab:
User Current Version:- 3.7.13 (default, Apr 24 2022, 01:04:09)
[GCC 7.5.0]
Here is the error message:
Building wheels for collected packages: AutoROM.accept-rom-license
Building wheel for AutoROM.accept-rom-license (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: '/home/jamshaid/PycharmProjects/Edge Caching using stable-baselines3/virtualenv/bin/python' '/home/jamshaid/PycharmProjects/Edge Caching using stable-baselines3/virtualenv/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py' build_wheel /tmp/tmpp4hjhtme
cwd: /tmp/pip-install-o4p_ksow/autorom-accept-rom-license_8ed43d51fff74c73944a3a9f954d2153
Complete output (62 lines):
running bdist_wheel
running build
running install
running install_egg_info
Traceback (most recent call last):
File "/home/jamshaid/PycharmProjects/Edge Caching using stable-baselines3/virtualenv/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/jamshaid/PycharmProjects/Edge Caching using stable-baselines3/virtualenv/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/jamshaid/PycharmProjects/Edge Caching using stable-baselines3/virtualenv/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 262, in build_wheel
metadata_directory)
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 231, in build_wheel
wheel_directory, config_settings)
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 18, in <module>
cmdclass={"install": InstallCommand},
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
self.run_command('install')
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "setup.py", line 8, in run
super().run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 622, in run
self.run_command(cmd_name)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/command/install_egg_info.py", line 26, in finalize_options
('install_dir', 'install_dir'))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 287, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
self.set_undefined_options('install',('install_layout','install_layout'))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout
----------------------------------------
ERROR: Failed building wheel for AutoROM.accept-rom-license
Failed to build AutoROM.accept-rom-license
ERROR: Could not build wheels for AutoROM.accept-rom-license, which is required to install pyproject.toml-based projects

Unable to install PyAutoGui on Linux

I'm trying to install pyautogui, and have an error.
I tried to install pyautogui on older python version, and have same error.
I also tried to install all dependencies separately, and got same error.
Command I ran:
python3.10 -m pip install pyautogui
Python version: 3.10.2
Pip version: 22.0.4
Error:
× Building wheel for pymsgbox (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [60 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/pymsgbox
copying src/pymsgbox/_native_win.py -> build/lib/pymsgbox
copying src/pymsgbox/__init__.py -> build/lib/pymsgbox
running install
running install_lib
Traceback (most recent call last):
File "/home/excl/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/excl/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/excl/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 13, in <module>
setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
self.run_command('install')
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 622, in run
self.run_command(cmd_name)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
self.set_undefined_options('install',('install_layout','install_layout'))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout. Did you mean: 'install_platlib'?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pymsgbox
Failed to build pyscreeze pymsgbox
ERROR: Could not build wheels for pyscreeze, pymsgbox, which is required to install pyproject.toml-based projects
Fixed with using an older version of dependencies and an older version of pyautogui (0.9.52).
I had the exact issue with other packages after upgrading to Ubuntu 22.04, and it apparently comes from setuptools. Following this: pypa/setuptools#3278
I tried to run: export SETUPTOOLS_USE_DISTUTILS=stdlib in a terminal, and it worked like a charm!

Attempting to install a specific version of Regex under Python getting a Type Error to do with the path

W10
Python 3.7.2
Pip3 19.3.1
Am trying to install regex as part of a larger install using the following command line:
pip install regex==2017.4.5
However I'm getting the following error:
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
With the following stack trace:
ERROR: Command errored out with exit status 1:
command: 'c:\py\py\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-mkqyqr4j\\regex\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-mkqyqr4j\\regex\\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\Admin\AppData\Local\Temp\pip-record-vkvvafct\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\py\py\include\site\python3.7\regex'
cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-mkqyqr4j\regex\
Complete output (61 lines):
c:\py\py\lib\site-packages\setuptools\dist.py:476: UserWarning: Normalizing '2017.04.05' to '2017.4.5'
normalized_version,
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying Python3\regex.py -> build\lib.win-amd64-3.7
copying Python3\_regex_core.py -> build\lib.win-amd64-3.7
copying Python3\test_regex.py -> build\lib.win-amd64-3.7
running build_ext
building '_regex' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Temp\pip-install-mkqyqr4j\regex\setup.py", line 56, in <module>
os.path.join(PKG_BASE, '_regex_unicode.c')])],
File "c:\py\py\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\py\py\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\py\py\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
_build_ext.run(self)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "c:\py\py\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension
_build_ext.build_extension(self, ext)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\_msvccompiler.py", line 345, in compile
self.initialize()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\Lib\distutils\_msvccompiler.py", line 238, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\py\py\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:\py\py\lib\site-packages\setuptools\msvc.py", line 1620, in return_env
if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
File "c:\py\py\lib\genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
----------------------------------------
Figure maybe my config is off as installing something as basic as regex shouldn't be a show stopper
Any advice gratefully received

cannot install setup.py properly for face recognition

i was trying to install face_recognition on spyder and i have to install cnmake and dlib first so while installing dlib i came across this error.
i tried following this site to install dlib but i got stuck
https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf
this is what they show on command prompt
C:\Users\L30809\Desktop\dlib-master>python setup.py install
running install
running bdist_egg
running egg_info
writing dlib.egg-info\PKG-INFO
writing dependency_links to dlib.egg-info\dependency_links.txt
writing top-level names to dlib.egg-info\top_level.txt
package init file 'dlib\__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools\python\build*'
writing manifest file 'dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Traceback (most recent call last):
File "setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\ProgramData\Anaconda3\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "setup.py", line 126, in get_cmake_version
return re.search(r'version\s*([\d.]+)', out.decode()).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
and this is what they show on spyder
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
Complete output from command C:\ProgramData\Anaconda3\pythonw.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\L30809\\AppData\\Local\\Temp\\pip-install-o0volf3j\\dlib\\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\L30809\AppData\Local\Temp\pip-record-spg4otqt\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\L30809\AppData\Local\Temp\pip-install-o0volf3j\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\L30809\AppData\Local\Temp\pip-install-o0volf3j\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\L30809\AppData\Local\Temp\pip-install-o0volf3j\dlib\setup.py", line 126, in get_cmake_version
return re.search(r'version\s*([\d.]+)', out.decode()).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
----------------------------------------
Note: you may need to restart the kernel to use updated packages.
Failed building wheel for dlib
Command "C:\ProgramData\Anaconda3\pythonw.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\L30809\\AppData\\Local\\Temp\\pip-install-

ImportError: No module named pyodbc (Windows )

Python 3.3, pip is installed and PATH is:
C:\Python33\Scripts
I have downloaded visual c++ 2010, do I need to change any configuration or add the .bat file to python 33 package from vc++?
When I try to install pyodbc I get the following:
C:\Users\elyon>pip install https://pyodbc.googlecode.com/files/pyodbc-3.0.7.zip Collecting https://pyodbc.googlecode.com/files/pyodbc-3.0.7.zip Using cached https://pyodbc.googlecode.com/files/pyodbc-3.0.7.zip Installing collected packages: pyodbc Running setup.py install for pyodbc
building 'pyodbc' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\elyon\appdata\local\temp\pip-30p009-build\setup.py", lin e 288, in <module>
main()
File "c:\users\elyon\appdata\local\temp\pip-30p009-build\setup.py", lin e 108, in main
setup(**kwargs)
File "C:\Python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\install.py", line 61, in run
File "C:\Python33\lib\distutils\command\install.py", line 569, in run
self.run_command('build')
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\build_ext.py", line 50, in run
File "C:\Python33\lib\distutils\command\build_ext.py", line 347, in run
self.build_extensions()
File "C:\Python33\lib\distutils\command\build_ext.py", line 456, in build_ extensions
self.build_extension(ext)
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\build_ext.py", line 183, in build_extension
File "C:\Python33\lib\distutils\command\build_ext.py", line 511, in build_ extension
depends=ext.depends)
File "C:\Python33\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\Python33\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \msvc9_support.py", line 52, in query_vcvarsall
File "C:\Python33\lib\distutils\msvc9compiler.py", line 287, in query_vcva rsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
Complete output from command C:\Python33\python.EXE -c "import setuptools, t okenize;__file__='c:\\users\\elyon\\appdata\\local\\temp\\pip-30p009-build\\s etup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace(' \r\n', '\n'), __file__, 'exec'))" install --record c:\users\elyon\appdata\loc al\temp\pip-v0vcs5-record\install-record.txt
--single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\elyon\appdata\local\temp\pip-30p009-build\setup.py", lin e 288, in <module>
main()
File "c:\users\elyon\appdata\local\temp\pip-30p009-build\setup.py", lin e 108, in main
setup(**kwargs)
File "C:\Python33\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands
self.run_command(cmd)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\install.py", line 61, in run
File "C:\Python33\lib\distutils\command\install.py", line 569, in run
self.run_command('build')
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
cmd_obj.run()
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\build_ext.py", line 50, in run
File "C:\Python33\lib\distutils\command\build_ext.py", line 347, in run
self.build_extensions()
File "C:\Python33\lib\distutils\command\build_ext.py", line 456, in build_ extensions
self.build_extension(ext)
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \command\build_ext.py", line 183, in build_extension
File "C:\Python33\lib\distutils\command\build_ext.py", line 511, in build_ extension
depends=ext.depends)
File "C:\Python33\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\Python33\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python33\lib\site-packages\setuptools-12.0.3-py3.3.egg\setuptools \msvc9_support.py", line 52, in query_vcvarsall
File "C:\Python33\lib\distutils\msvc9compiler.py", line 287, in query_vcva rsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
----------------------------------------
Command "C:\Python33\python.EXE -c "import setuptools, tokenize;__file__='c: \\users\\elyon\\appdata\\local\\temp\\pip-30p009-build\\setup.py';exec(compil e(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file
__, 'exec'))" install --record c:\users\elyon\appdata\local\temp\pip-v0vcs5-r ecord\install-record.txt --single-version-externally-managed
--compile" failed w ith error code 1 in
c:\users\elyon\appdata\local\temp\pip-30p009-build
This is the code:
import pyodbc
print pyodbc.dataSources()
print "Connecting via ODBC"
conn = pyodbc.connect("DRIVER={Netezza};SERVER=netezza201;PORT=5480;DATABASE=Test;UID=CompanyUser;PWD=Password!;")
cursor = conn.cursor()
I had this problem under Python 2.7.9 using SQLAlchemy and the solution was to unpack the pyodbc .egg file in my site-packages folder.
I must note that I didn't compile it myself, I downloaded the binary (pyodbc-3.0.7.win32-py2.7.exe) and I installed it using easy_install pyodbc-3.0.7.win32-py2.7.exe
P.S: Newer .whl type installers can be found here, you can install them using pip install [.whl file]. That might also help you get pyodbc installed.
Navigate to the \Lib\site-packages folder for your current virtualenv (or under your main Python installation folder if you're not using a virtualenv).
Rename pyodbc-3.0.7-py2.7-win32.egg to pyodbc-3.0.7-py2.7-win32.zip.
Extract the zip file and place the contents directly in your \Lib\site-packages folder.
After I did this the pyodbc module go recognised and SQLAlchemy could import it.

Categories

Resources