I can't install kivy on windows 10 with py3.5 - python

I can't install kivy on windows 10. What can i do? Here are errors.
C:\WINDOWS\system32>python -m pip install kivy
Collecting kivy
Using cached kivy-1.9.1.tar.gz
Requirement already satisfied: Kivy-Garden>=0.1.4 in c:\users\kenan\appdata\local\programs\python\python35-32\lib\site-packages (from kivy)
Requirement already satisfied: requests in c:\users\kenan\appdata\local\programs\python\python35-32\lib\site-packages (from Kivy-Garden>=0.1.4->kivy)
Building wheels for collected packages: kivy
Running setup.py bdist_wheel for kivy ... error
Complete output from command C:\Users\kenan\AppData\Local\Programs\Python\Python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\kenan\\AppData\\Local\\Temp\\pip-build-9ojxbuh8\\kivy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\kenan\AppData\Local\Temp\tmp86qekmsbpip-wheel- --python-tag cp35:
Using distutils
Detected Cython version 0.23
User distribution detected, avoid portable command.
Windows platform detected, force GLEW usage.
Using this graphics system: OpenGL
WARNING: A problem occured while running pkg-config --libs --cflags gstreamer-1.0 (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
WARNING: A problem occured while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
Build configuration is:
* use_rpi = 0
* use_mali = 0
* use_egl = 0
* use_opengl_es2 = 0
* use_opengl_debug = 0
* use_glew = 1
* use_sdl2 = 0
* use_ios = 0
* use_mesagl = 0
* use_x11 = 0
* use_gstreamer = 0
* use_avfoundation = 0
* use_osx_frameworks = 0
* debug_gl = 0
* debug = False
Detected compiler is msvc
C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\winrt" /TcC:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vertex_instructions.c /Fobuild\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vertex_instructions.obj
vertex_instructions.c
c:\users\kenan\appdata\local\temp\pip-build-9ojxbuh8\kivy\kivy\graphics\gl_redirect.h(8): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for kivy
Running setup.py clean for kivy
Failed to build kivy
Installing collected packages: kivy
Running setup.py install for kivy ... error
Complete output from command C:\Users\kenan\AppData\Local\Programs\Python\Python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\kenan\\AppData\\Local\\Temp\\pip-build-9ojxbuh8\\kivy\\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\kenan\AppData\Local\Temp\pip-9ucs7wug-record\install-record.txt --single-version-externally-managed --compile:
Using distutils
Detected Cython version 0.23
User distribution detected, avoid portable command.
Windows platform detected, force GLEW usage.
Using this graphics system: OpenGL
WARNING: A problem occured while running pkg-config --libs --cflags gstreamer-1.0 (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
WARNING: A problem occured while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
Build configuration is:
* use_rpi = 0
* use_mali = 0
* use_egl = 0
* use_opengl_es2 = 0
* use_opengl_debug = 0
* use_glew = 1
* use_sdl2 = 0
* use_ios = 0
* use_mesagl = 0
* use_x11 = 0
* use_gstreamer = 0
* use_avfoundation = 0
* use_osx_frameworks = 0
* debug_gl = 0
* debug = False
Detected compiler is msvc
cythoning C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics/vbo.pyx to C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.c
building 'kivy.graphics.vbo' extension
creating build\temp.win32-3.5
creating build\temp.win32-3.5\Release
creating build\temp.win32-3.5\Release\Users
creating build\temp.win32-3.5\Release\Users\kenan
creating build\temp.win32-3.5\Release\Users\kenan\AppData
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics
C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\winrt" /TcC:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.c /Fobuild\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.obj
vbo.c
c:\users\kenan\appdata\local\temp\pip-build-9ojxbuh8\kivy\kivy\graphics\gl_redirect.h(8): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\kenan\AppData\Local\Programs\Python\Python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\kenan\\AppData\\Local\\Temp\\pip-build-9ojxbuh8\\kivy\\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\kenan\AppData\Local\Temp\pip-9ucs7wug-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\*

Kivy now has 3.4, 3.5, 3.6 wheels, no compilation necessary. See installation documentation. The error is because you were trying to install Kivy from pip, where is only the stable version now (1.9.1), which is a little bit old and the code doesn't support py3.5 and higher in that state.
MSVC needs a little bit of tweaking and patches. The whole instructions are in pull requests, but those are still experimental only and there's a need to fix a pointer mismatch (another pull request).
Otherwise Kivy (at least for py3.4 and lower) uses gcc. How to compile is written here
However, for casual usage you don't need to compile, because there are wheels. If you read the docs properly, you'll find out how to install it.
If you encounter Window error, search here, there are already answered questions.
There are even unofficial wheels for py3.5 somewhere.

Install PIP
Upgrade PIP
Install Microsoft CPP BUILD TOOLS. Google it, you can find it easily if this link is broken.
Download Kivy Package from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame You might face
issues of "Wheel package is not supported". Just look for the
package with win32 with/without AMD. Still, if you keep getting the
same error, Just try downloading the different package and follow
the following steps. Took me to download 3 Packages to get it right.
Open CMD
Change Directory to Downloads (Or wherever the package is
downloaded)
Do pip install completePackageName.whl
Ex: C:\Users\UserName\Downloads>pip install
Kivy-1.9.1+sdl2-cp35-cp35m-win32.whl

Hi im using py38 and win10 too,
check this https://github.com/kivy/kivy/issues/6563
Anyone recommend run this command, (it works for me)
pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/
or try with https://www.lfd.uci.edu/~gohlke/pythonlibs/#kivy

Related

Install pysqlcipher3 windows

I need to install pysqlcipher on my windows computer but when I do:
pip install pysqlcipher
I have:
Collecting pysqlcipher3
Using cached https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz
Building wheels for collected packages: pysqlcipher3
Building wheel for pysqlcipher3 (setup.py) ... done
WARNING: Legacy build of wheel for 'pysqlcipher3' created no files.
Command arguments: 'C:\Users\Elouan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Elouan\\AppData\\Local\\Temp\\pip-install-827zddbs\\pysqlcipher3\\setup.py'"'"'; __file__='"'"'C:\\Users\\Elouan\\AppData\\Local\\Temp\\pip-install-827zddbs\\pysqlcipher3\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Elouan\AppData\Local\Temp\pip-wheel-jkj29o6_' --python-tag cp38
Command output: [use --verbose to show]
Running setup.py clean for pysqlcipher3
Failed to build pysqlcipher3
Installing collected packages: pysqlcipher3
Running setup.py install for pysqlcipher3 ... done
Successfully installed pysqlcipher3
WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I have tried to install it with git and I have:
python setup.py build
running build
running build_py
running build_ext
Builds a C extension linking against libsqlcipher library
building 'pysqlcipher3._sqlite3' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlcipher3.dbapi2\" -IC:\Users\Elouan\AppData\Local\Programs\Python\Python37\include -IC:\Users\Elouan\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IF:\Windows Kits\10\include\10.0.18362.0\ucrt" "-IF:\Windows Kits\10\include\10.0.18362.0\shared" "-IF:\Windows Kits\10\include\10.0.18362.0\um" "-IF:\Windows Kits\10\include\10.0.18362.0\winrt" "-IF:\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc\python3\module.c /Fobuild\temp.win-amd64-3.7\Release\src\python3\module.obj
module.c
C:\Users\Elouan\pysqlcipher3\src\python3\connection.h(33): fatal error C1083: Impossible d'ouvrir le fichier include : 'sqlcipher/sqlite3.h' : No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
I tried that with python3 but it's the same.
I think it's like this problem:
Issue in installing pysqlcipher3
but I did not succeed to resolve the problem
Someone can help me please?
Install tlc (i'm use 8.6)
https://www.activestate.com/products/tcl/downloads/
(tclsh*.exe) is available in the PATH.(tclsh C:\Tcl\bin\tclsh.exe)
Install VISUAL STUDIO (add) and VISUAL STUDIO C++ Build
go to microsoft
Install OpenSSL x64 or x32 (i'm use x64)
https://slproweb.com/products/Win32OpenSSL.html
add to PATH
x64
OPENSSL_CONF C:\Program Files\OpenSSL-Win64\bin\openssl.cfg
x32
OPENSSL_CONF C:\Program Files(x86)\OpenSSL-Win32\bin\openssl.cfg
in folder
C:\Program Files\OpenSSL-Win64\lib
save copy
libcrypto.def and libcrypto.lib
and rename at
libeay32.def and libeay32.lib
save copy
libssl.def and libssl.lib
and rename at
ssleay32.def and ssleay32.lib
copy folder
C:\Program Files\OpenSSL-Win64\include\openssl
to
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include
Download sqlcipher
https://github.com/sqlcipher/sqlcipher
in root sqlcipher change Makefile.msc
this
TCC = $(TCC) -DSQLITE_TEMP_STORE=1
change to
TCC = $(TCC) -DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC -I"C:\Program Files\OpenSSL-Win64\include"
next
# If ICU support is enabled, add the linker options for it.
#
!IF $(USE_ICU)!=0
LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
LTLIBS = $(LTLIBS) $(LIBICU)
!ENDIF
# <</mark>>
# You should not have to change anything below this line
change to
# If ICU support is enabled, add the linker options for it.
#
!IF $(USE_ICU)!=0
LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:$(ICULIBDIR)
LTLIBS = $(LTLIBS) $(LIBICU)
!ENDIF
# <</mark>>
LTLIBPATHS = $(LTLIBPATHS) /LIBPATH:"C:\Program Files\OpenSSL-Win64\lib\VC\static"
LTLIBS = $(LTLIBS) libcrypto64MT.lib libssl64MT.lib ws2_32.lib shell32.lib advapi32.lib gdi32.lib user32.lib crypt32.lib
# You should not have to change anything below this line
x64 Native Tools Command (VS)
path\to\sqlcipher>
nmake /f Makefile.msc clean
nmake /f Makefile.msc
Download pysqlcipher3
https://github.com/rigglemania/pysqlcipher3
create folder
/amalgamation in /pysqlcipher3
COPY TWO FILES FROM /sqlcipher
sqlite3.c sqlite3.h
TO /pysqlcipher3/amalgamation
Download sqlite-amalgamation
https://sqlite.org/download.html
i'm use https://sqlite.org/2021/sqlite-amalgamation-3340100.zip
create folder
/pysqlcipher3/src/python3/sqlcipher
copy 4 files from sqlite-amalgamation-3340100.zip
shell.c sqlite3.c sqlite.h sqliteext.h
to
/pysqlcipher3/src/python3/sqlcipher
x64 Native Tools Command (VS)
path\to\pysqlcipher3>
setup.py clean
enter code here
setup.py build_amalgamation
setup.py install

Can't install pyaudio using pip [duplicate]

This question already has answers here:
How do I install PyAudio on Python 3.7?
(9 answers)
Closed 3 years ago.
I tried installing pyaudio using pip but I am getting an error.
C:\Users\divya>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command "c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\divya\\AppData\\Local\\Temp\\pip-install-5eoc_ykq\\pyaudio\\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\divya\AppData\Local\Temp\pip-record-xhzsi_4l\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT "-Ic:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Command ""c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\divya\\AppData\\Local\\Temp\\pip-install-5eoc_ykq\\pyaudio\\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\divya\AppData\Local\Temp\pip-record-xhzsi_4l\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\divya\AppData\Local\Temp\pip-install-5eoc_ykq\pyaudio\
please see this error and help me out I am getting similar error while installing pyGTK too. I tried upgrading pip too but nothing worked for me.
There is no prebuilt package for Python 3.7 on Windows (you have a 32 bit version probably) so you need to prepare build environment on your PC to use this package. Easier would be finding the wheel for 3.7 as some packages are quite hard to build on Windows.
You can find your wheel here
Check your python version and download your correct wheel
after that you can type to install:
pip install <yourwheel.whl>

Python package(s) install failure on packages that requires C source compiling (Visual Studio 2017)

In Visual Studio's Python, i can install packages, which as far as i know doesn't require C source compiling. When it comes to packages that requires compiling, it's always fail. My installation attempts are always done via pip install package-name inside the Visual Studio. This is what i have tried :
Installing Visual Studio 2015 (VS 14.0) C/C++ Standalone compiler
Try to re-install the package after compiler installation, still fail
Restarting the machine, then try to re-install the package, still fail
Specifically, i have tried to install RPIO and RPi.GPIO, more or less it give similar error message :
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
Here is the full log from the RPIO installation attempt :
----- Installing 'RPIO==0.10.0' -----
Collecting RPIO==0.10.0
Using cached RPIO-0.10.0.tar.gz
Installing collected packages: RPIO
Running setup.py install for RPIO: started
Running setup.py install for RPIO: finished with status 'error'
Complete output from command "C:\Program Files\Python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\ELEMEN~1\\AppData\\Local\\Temp\\pip-build-4lvb_8wu\\RPIO\\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\ELEMEN~1\AppData\Local\Temp\pip-oqz8bi8d-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\RPIO
copying source\RPIO\Exceptions.py -build\lib.win-amd64-3.6\RPIO
copying source\RPIO\_RPIO.py -build\lib.win-amd64-3.6\RPIO
copying source\RPIO\__init__.py -build\lib.win-amd64-3.6\RPIO
creating build\lib.win-amd64-3.6\RPIO\PWM
copying source\RPIO\PWM\__init__.py -build\lib.win-amd64-3.6\RPIO\PWM
running build_ext
building 'RPIO._GPIO' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\source
creating build\temp.win-amd64-3.6\Release\source\c_gpio
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Python36\include" "-IC:\Program Files\Python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tcsource/c_gpio/py_gpio.c /Fobuild\temp.win-amd64-3.6\Release\source/c_gpio/py_gpio.obj
py_gpio.c
source/c_gpio/py_gpio.c(361): error C2373: 'setmode': redefinition; different type modifiers
C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\corecrt_io.h(528): note: see declaration of 'setmode'
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 1 different from declaration
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 2 different from declaration
source/c_gpio/py_gpio.c(431): warning C4047: 'initializing': 'PyCFunction' differs in levels of indirection from 'int (__cdecl *)(int,int)'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command ""C:\Program Files\Python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\ELEMEN~1\\AppData\\Local\\Temp\\pip-build-4lvb_8wu\\RPIO\\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\ELEMEN~1\AppData\Local\Temp\pip-oqz8bi8d-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ELEMEN~1\AppData\Local\Temp\pip-build-4lvb_8wu\RPIO\
----- Failed to install 'RPIO==0.10.0' -----
So am i missing something ? Or is it the package's source that missing something ?
Thank you
It looks like py_gpio.c is redefining setmode (line 361, used at line 431). This is a bug in their code, so you should find the team who owns it and report it to them. Most likely they added it to support older versions of MSVC, and should not add it for the current version.
It also appears that the code is using a different definition than what the C runtime has, which could later cause problems if the variable types do not match. A full code review may be needed here.
In any case, this appears to be a problem with the RPi.GPIO package and not with your install or the tools you are using.
First, thank you #martineau for hinting the problems
This is not a whole solution, but rather some workaround.
1. Use Another IDE / Tool
While the library still not compatible with the Windows toolchain, you can try another tool or IDE that might do.
2. Another library
This is the workaround that i take. Basically, i need Python library for accessing RPi GPIO, the said RPi.GPIO and RPIO won't be installed on the Windows ver. of Python, so i move to another library called gpiozero. It is compatible with the Windows Python (it's successfully pip-ed in VS) and so far provide functionalities that i need.

Python TA-Lib install problems

Frustratingly having a lot of difficult installing the TA-Lib package in python.
https://pypi.python.org/pypi/TA-Lib
I have read through all the forum posts I can find on this but no such luck for my particular problem..
Windows 10
Python 3.5.2
Anaconda 4.2.0
Cython 0.24.1
Microsoft Visual Studio 14.0
I have downloaded and extracted  ta-lib-0.4.0-msvc.zip to C:/TA-Lib
(common problems seem to be people not installing the underlying TA-Lib file http://www.ta-lib.org/hdr_dw.html)
If someone could help me solve this I would be very appreciative!
Using 'pip install ta-lib' I get the following:
C:\Users\Matt>pip install ta-lib
Collecting ta-lib
Using cached TA-Lib-0.4.10.tar.gz
Building wheels for collected packages: ta-lib
Running setup.py bdist_wheel for ta-lib ... error
Complete output from command c:\users\matt\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Matt\\AppData\\Local\\Temp\\pip-build-vv02ktg_\\ta-lib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Matt\AppData\Local\Temp\tmpqstzmsgspip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\talib
copying talib\deprecated.py -> build\lib.win-amd64-3.5\talib
copying talib\test_abstract.py -> build\lib.win-amd64-3.5\talib
copying talib\test_data.py -> build\lib.win-amd64-3.5\talib
copying talib\test_func.py -> build\lib.win-amd64-3.5\talib
copying talib\test_stream.py -> build\lib.win-amd64-3.5\talib
copying talib\__init__.py -> build\lib.win-amd64-3.5\talib
running build_ext
skipping 'talib\common.c' Cython extension (up-to-date)
building 'talib.common' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\talib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\matt\anaconda3\lib\site-packages\numpy\core\include -Ic:\ta-lib\c\include -Ic:\users\matt\anaconda3\include -Ic:\users\matt\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tctalib\common.c /Fobuild\temp.win-amd64-3.5\Release\talib\common.obj
common.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\ta-lib\c\lib /LIBPATH:c:\users\matt\anaconda3\libs /LIBPATH:c:\users\matt\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" ta_libc_cdr.lib /EXPORT:PyInit_common build\temp.win-amd64-3.5\Release\talib\common.obj /OUT:build\lib.win-amd64-3.5\talib\common.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.lib
common.obj : warning LNK4197: export 'PyInit_common' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.exp
common.obj : error LNK2001: unresolved external symbol TA_SetUnstablePeriod
common.obj : error LNK2001: unresolved external symbol TA_Shutdown
common.obj : error LNK2001: unresolved external symbol TA_Initialize
common.obj : error LNK2001: unresolved external symbol TA_GetUnstablePeriod
common.obj : error LNK2001: unresolved external symbol TA_GetVersionString
build\lib.win-amd64-3.5\talib\common.cp35-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120
----------------------------------------
Failed building wheel for ta-lib
Running setup.py clean for ta-lib
Failed to build ta-lib
Installing collected packages: ta-lib
Running setup.py install for ta-lib ... error
Complete output from command c:\users\matt\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Matt\\AppData\\Local\\Temp\\pip-build-vv02ktg_\\ta-lib\\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\Matt\AppData\Local\Temp\pip-qxmjmn5m-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\talib
copying talib\deprecated.py -> build\lib.win-amd64-3.5\talib
copying talib\test_abstract.py -> build\lib.win-amd64-3.5\talib
copying talib\test_data.py -> build\lib.win-amd64-3.5\talib
copying talib\test_func.py -> build\lib.win-amd64-3.5\talib
copying talib\test_stream.py -> build\lib.win-amd64-3.5\talib
copying talib\__init__.py -> build\lib.win-amd64-3.5\talib
running build_ext
skipping 'talib\common.c' Cython extension (up-to-date)
building 'talib.common' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\talib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\matt\anaconda3\lib\site-packages\numpy\core\include -Ic:\ta-lib\c\include -Ic:\users\matt\anaconda3\include -Ic:\users\matt\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tctalib\common.c /Fobuild\temp.win-amd64-3.5\Release\talib\common.obj
common.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\ta-lib\c\lib /LIBPATH:c:\users\matt\anaconda3\libs /LIBPATH:c:\users\matt\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" ta_libc_cdr.lib /EXPORT:PyInit_common build\temp.win-amd64-3.5\Release\talib\common.obj /OUT:build\lib.win-amd64-3.5\talib\common.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.lib
common.obj : warning LNK4197: export 'PyInit_common' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\talib\common.cp35-win_amd64.exp
common.obj : error LNK2001: unresolved external symbol TA_SetUnstablePeriod
common.obj : error LNK2001: unresolved external symbol TA_Shutdown
common.obj : error LNK2001: unresolved external symbol TA_Initialize
common.obj : error LNK2001: unresolved external symbol TA_GetUnstablePeriod
common.obj : error LNK2001: unresolved external symbol TA_GetVersionString
build\lib.win-amd64-3.5\talib\common.cp35-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120
----------------------------------------
Command "c:\users\matt\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Matt\\AppData\\Local\\Temp\\pip-build-vv02ktg_\\ta-lib\\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\Matt\AppData\Local\Temp\pip-qxmjmn5m-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Matt\AppData\Local\Temp\pip-build-vv02ktg_\ta-lib\
You could try the "Unofficial Windows Binaries for Python Extension Packages
by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine."
http://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
He has different versions compiled depending on OS and Python versions. You probably need TA_Lib‑0.4.10‑cp35‑cp35m‑win_amd64.whl
Good luck.
Download ta-lib-0.4.0-msvc.zip from http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
This is a 32-bit release. If you want to use 64-bit Python, you will need to build a 64-bit version of the library.
Some unofficial (and unsupported) instructions for building on 64-bit Windows 10, here for reference:
Download and Unzip ta-lib-0.4.0-msvc.zip
Move the Unzipped Folder ta-lib to C:\
Download and Install Visual Studio Community 2015 or 2017 - have to do the big install i'm afraid - no other way
Remember to Select [Visual C++] Feature
Build TA-Lib Library - From Windows Start Menu, Start [VS2015 x64 Native Tools Command Prompt]
cd to C:\ta-lib\c\make\cdr\win32\msvc
Build the Library by typing nmake
Try installing ta-lib again from pip or pycharm etc...
you can proceed as follows:
Go to the following page: https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
Choose your version of python: cp35 means Python 3.5 (64 bit for example)
Download the package and unzip in ...\Python\Python35\Scripts
Go on cmd and in the same directory (...\Python\Python35\Scripts) execute the following command:
pip3 install TA_Lib-0.4.17-cp35-cp35m-win_amd64.whl
installed!
In order to use the python package you need the dependencies first. For mac you can just use brew install ta-lib and then pip install TA-Lib will work just fine.
While there are similar answers but I thought I would take a crack at it.
Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib and download the relevant .whl file.
From the info given, I would suggest the file name, TA_Lib‑0.4.17‑cp35‑cp35m‑win_amd64.whl
I find Anaconda environment good for python, so I would suggest installing Anaconda and placing the file in the same folder location which is shown on the Anaconda prompt.
screenshot of Anaconda installer
In the Anaconda prompt, use the pip install command with the file name of the downloaded file.
Since we have downloaded the file, TA_Lib‑0.4.17‑cp37‑cp37m‑win_amd64.whl, the command would be:
pip install TA_Lib‑0.4.17‑cp35‑cp35m‑win_amd64.whl`
If there is no error, then it implies that we have successfully installed Ta-Lib.
You should get something like this: install Ta-lib
Source: https://blog.quantinsti.com/install-ta-lib-python/
From https://github.com/mrjbq7/ta-lib:
'This typically means that it can't find the underlying TA-Lib library, a dependency which needs to be installed.'
Install the underlying TA-Lib library first from here:
https://www.ta-lib.org/hdr_dw.html
I used the 'ta-lib-0.4.0-msvc.zip' one.
Then download a whl file from: https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
I used the 'TA_Lib‑0.4.16‑cp35‑cp35m‑win_amd64.whl' one.
I can not definitely remember but I think I lastly ran pip install TA-Lib as well
I faced the same problems trying with Anaconda 5.1.0 and Python 3.6 via Visual Studio.
The solution was to get a wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs, then install it via pip. You need to make sure the wheel matches your python version (in my case, 3.6).
In Anaconda, I just opened a prompt, navigated to where the wheel was, and ran the following:
python -m pip install TA_Lib-0.4.17-cp36-cp36m-win_amd64.whl
For Visual Studio, it was more obtuse. Go to the Python Environments tab, choose 'Overview' in the dropdown, then `Open in PowerShell'. At that point, run the same command as for ANaconda above.
Download related package from
https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
TA_Lib‑0.4.17‑cp36‑cp36m‑win_amd64.whl (Since I have python 3.6, cp36)
and use
pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win_amd64.whl
The following solved the issue I had installing ta-lib for Python:
OS: Windows 10
Python: 2.7, embedded in miniconda.
Miniconda: 64 bits.
PyCharm 2018.1.4 Community Edition.
You need to convert ta-lib to 64 bits. You can find it already converted in here.
The site also tells you what to do, however there are several steps not included or confusing there that I am explaining here.
It is important that you do not just unzip the file 'ta-lib x64.zip' at 'C:'. Inside the zip file, there is a 'ta-lib' folder. This folder is the one that has to be in 'C:'
From the same github account, download and execute C++ Build Tools en_visual_cpp_build_tools_2015_update_3_x86_x64_8923157.exe.
Microsoft Visual C++ 9.0 is required. Get it from here.
You must download and install it, in case you don't already have it.
Inside your python environment, run pip install ta-lib
This worked for me, I hope this info is useful for you.
Note: At the time, there is no TA-lib developed for Python 3.x, that is why I used Python 2.7
Install an updated Microsoft visual c++ Redistributable for Visual Studio 2015, 2017 and 2019:
https://support.microsoft.com/he-il/help/2977003/the-latest-supported-visual-c-downloads
worked for me..
Had to spend good amount of time even with so many people facing the same issue. Long story short WINDOWS ***T. I am on Windows 10 running python3.7
Enough of ranting here are the steps that worked for me
Install Visual C++ Build tools (https://www.youtube.com/watch?v=P4_R34Lb-PE)
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
While installing Build tools make sure you have selected Windows10 SDK that resolved some io.h file not found error. I had to modify the installation multiple times by adding Visual C++ components.
After this pip3 install ta-lib or python3 -m pip install ta-lib didn't work. What worked was downloading those .whl files as mentioned above [https://www.lfd.uci.edu/~gohlke/pythonlibs] and since I have python3.7 I had to select the one with cp37 (TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl) in it.
I hope I am not missing any step but by the time I figured above steps I was 4 hours older.
From everything that I have tried, the simplest way to solve this was more obvious than it looked based on previous answers. Run the following command on your conda terminal:
conda install -c conda-forge ta-lib
Make sure you are running this command on the desired environment.

GMPY2 Not installing, mpir.h not found

I am trying to install gmpy2 on my Anaconda Python 3.5 distribution using pip. I was able to install other modules such as primefac perfectly. When I try to install gmpy2 this is what I get:
(C:\Program Files\Anaconda3) C:\WINDOWS\system32>pip install gmpy2
Collecting gmpy2
Using cached gmpy2-2.0.8.zip
Building wheels for collected packages: gmpy2
Running setup.py bdist_wheel for gmpy2 ... error
Complete output from command "C:\Program Files\Anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\HADIKH~1\\AppData\\Local\\Temp\\pip-build-hd7b270n\\gmpy2\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\HADIKH~1\AppData\Local\Temp\tmplefsjn80pip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_ext
building 'gmpy2' extension
creating build
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMPIR -DWITHMPFR -DWITHMPC "-IC:\Program Files\Anaconda3\include" "-IC:\Program Files\Anaconda3\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcsrc\gmpy2.c /Fobuild\temp.win-amd64-3.5\Release\src\gmpy2.obj
gmpy2.c
c:\users\hadi khan\appdata\local\temp\pip-build-hd7b270n\gmpy2\src\gmpy.h(104): fatal error C1083: Cannot open include file: 'mpir.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for gmpy2
I have noticed that whenever I try installing gmpy2 on a computer I always get some sort of error and it is a different one every time. Can someone please tell me how to fix this.
Thanks.
The reason is some required packages (especially below packages) aren't installed.
GMP: GNU Multiple Precision Arithmetic Library
MPFR: GNU Multiple-precision floating-point rounding library
MPC: GNU Multiple-precision C library
you could install those packages by below commands:
apt-get install libgmp-dev
apt-get install libmpfr-dev
apt-get install libmpc-dev
I could install gmpy2 by installing those libraries.
the key point is remembering below hint when you got an error like above.
# include "***.h": ==> No such file or directory
apt-get install lib"***"-dev
I maintain gmpy2 and unfortunately I have not been able to build Windows binaries for Python 3.5 and later. gmpy2 relies on either the MPIR or GMP libraries, and the MPFR and MPC libraries. There are detailed instructions included in the source distribution but they are not trivial to build on Windows. It is probably impossible(*) to build MPIR, MPFR, and MPC via pip. I would use the pre-compiled binaries available from http://www.lfd.uci.edu/~gohlke/pythonlibs/
(*) I'm sure it is possible with enough effort but I haven't done it.
The answer above works as noted, but i had to also find out how to install a wheel, which is answered here How do I install a Python package with a .whl file?
specifically, by copying the wheel file and executing (in my case), using pip 9
pip install C:\Python35\gmpy2-2.0.8-cp35-cp35m-win32.whl
Use conda to install instead of pip. conda will take care of installing the necessary dependencies. The command is: conda install gmpy2

Categories